import java.io.*;

// Uses the class Ward in file Ward.java


public class Election {

   public static void main (String[] args) throws IOException {

      // Will get input
      DataInputStream stdin = new DataInputStream(System.in);
      String input;
      int cand;
      
      // we have a city with two wards
      Ward ward1 = new Ward("Right side of tracks");  // 
      Ward ward2 = new Ward("Wrong side of tracks");  // 

      while (true) {
	 // input the ward number
	 input = stdin.readLine();
	 if (input.equals("done")) {  //  break out of loop if done
	    break;
	 }

	 // get the candidate number to vote for:
	 cand = Integer.parseInt(stdin.readLine());
	 
	 if (input.equals("1")) {
	    ward1.voteFor(cand);
	 }
	 else if (input.equals("2")) {
	    ward2.voteFor(cand);
	 }
	 else System.out.println("unknown ward.");
      }

      // print out the results
      ward1.printResults();
      ward2.printResults();
   }
}


