using System;

namespace ABC173
{
    class Program
    {
        static void Main(string[] args)
        {
            b();
        }

        public static void b()
        {
            int n = int.Parse(Console.ReadLine());
            int ac = 0;
            int wa = 0;
            int tle = 0;
            int re = 0;
            for(int i = 0; i < n; i++)
            {
                string s = Console.ReadLine();
                if (s == "AC")
                    ac++;
                else if (s == "WA")
                    wa++;
                else if (s == "TLE")
                    tle++;
                else
                    re++;
            }
            Console.WriteLine("AC * {0}",ac);
            Console.WriteLine("WA * {0}",wa);
            Console.WriteLine("TLE * {0}",tle);
            Console.WriteLine("RE * {0}",re);
        }
    }
}
