public class Hello{
    public static void Main(){
        // Your code here!
        var line=int.Parse(System.Console.ReadLine());
        string[] answer={"AC", "WA", "TLE", "RE"};
        int[] numbers=new int[4];
        
        for(var i=0;i<line;i++)
        {
            var data=System.Console.ReadLine();
            
            for(var j=0;j<numbers.Length;j++)
            {
                if(data==answer[j])
                {
                    numbers[j]=numbers[j]+1;
                }
            }
        }
        
        for(var k=0;k<answer.Length;k++)
        {
            System.Console.WriteLine(answer[k] +"x"+ numbers[k]);
        }
    }
}
