using System;

class Program
{
    static void Main(string[] args)
    {
        int ac = 0, wa = 0, tle = 0, re = 0;
        for(int i = 0, n = int.Parse(Console.ReadLine());i < n; i++)
        {
            switch (Console.ReadLine()) 
            {
                case "AC": ac++; break;
                case "WA": wa++; break;
                case "TLE":tle++;break;
                case "RE":re++;break;
            }

        }

        Console.WriteLine("AC x " + ac);
        Console.WriteLine("WA x " + wa);
        Console.WriteLine("TLE x" + tle);
        Console.WriteLine("RE x " + re);
    }



}
