using System;
using System.Linq;

class Test {
	static void Main(string[] args) {
      var inputs = System.Console.ReadLine()
    	.Split(' ')
    	.Select(s => int.Parse(s))
    	.ToArray();
      long N = inputs[0];
      long cntAC = 0;
      long cntWA = 0;
      long cntTLE = 0;
      long cntRE = 0;
      for(long i = 0; i < N; i++){
        string A = System.Console.ReadLine();
        if(A == "AC"){
          cntAC++;
        }else if(A == "WA"){
          cntWA++;
        }else if(A == "TLE"){
          cntTLE++;
        }else if(A == "RE"){
          cntWA++;
        }
      }
      Console.WriteLine("AC x " + cntAC);
      Console.WriteLine("WA x " + cntWA);
      Console.WriteLine("TLE x " + cntTLE);
      Console.WriteLine("RE x " + cntRE);
	}
}