using System;

namespace workspace{
  class Test{
    static void Main(){
      int N = Int32.Parse(Console.ReadLine());
      for(int i = 0; i < N ; i++){
        var S = Console.ReadLine();
        if(S == "AC"){
          ansAC++;
        }else if(S == "WA"){
          ansWA++;
        }else if(S == "TLE"){
          ansTLE++;
        }else{
          ansRE++;
        }
      }
      Console.WriteLine("AC x ${ansAC}");
      Console.WriteLine("WA x ${ansWA}");
      Console.WriteLine("TLE x ${ansTLE}");
      Console.WriteLine("RE x ${ansRE}");
    }
  }
}