public class Program {
  public static void Main() {
    long n = long.Parse(System.Console.ReadLine());
    long c0 = 0;
    long c1 = 0;
    long c2 = 0;
    long c3 = 0;
	for (int i = 0; i < n; i++;) {
      string input = Console.ReadLine();
      if (input == "AC") { c0++; }
      if (input == "WA") { c1++; }
      if (input == "TLE") { c2++; }
      if (input == "RE") { c3++; }
    }
    System.Console.WriteLine("AC x {0}", c0);
    System.Console.WriteLine("WA x {0}", c1);
    System.Console.WriteLine("TLE x {0}", c2);
    System.Console.WriteLine("RE x {0}", c3);
  }
}
