using System;

public class w{
 static void Main(){
   int N = int.Parse(Console.ReadLine());
   var res = new string[N];
   for(int i =0; i<N;i++){
    res[i] = Console.ReadLine();
   }
   Console.WriteLine("AC "+ "x "+res.Count(x=>x=="AC").ToString());
   Console.WriteLine("WA "+ "x "+res.Count(x=>x=="WA").ToString());
   Console.WriteLine("TLE "+ "x "+res.Count(x=>x=="TLE").ToString());
   Console.WriteLine("RE "+ "x "+res.Count(x=>x=="RE").ToString());
 }
}
