using System;

namespace ConsoleApp7
{
    class Program
    {
        static void Main(string[] args)
        {

            int[] at = new int[4];
            int n = int.Parse(System.Console.ReadLine());
            for (int i = 0; i < n; i++)
            {
                string a = System.Console.ReadLine();
                switch (a)
                {
                    case "AC":
                        at[0] += 1;
                        break;
                    case "TLE":
                        at[1] += 1;
                        break;
                    case "WA":
                        at[2] += 1;
                        break;
                    case "RE":
                        at[3] += 1;
                        break;
                }
              


            }
            string p = "AC x" + at[0];
            System.Console.WriteLine(p);
            p = "WA x" + at[2];
            System.Console.WriteLine(p);
            p = "TLE x" + at[1];
            System.Console.WriteLine(p);
            p = "RE x" + at[3];
            System.Console.WriteLine(p);
        }
    }
}