using System;

namespace ABC173_B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            int[] count = { 0, 0, 0, 0 };
            string[] results = { "AC", "WA", "TLE", "RE" };

            if(n != 0)
            {
                count = ReadResults(n, results);
            }

            for (int k = 0; k < results.Length; k++)
            {
                Console.WriteLine(results[k] + " x " + count[k]);
            }

            Console.ReadKey();
        }

        static int[] ReadResults(int n, string[] results)
        {
            int[] count = new int[results.Length];

            for (int i = 0; i < n; i++)
            {
                string result = Console.ReadLine();

                for (int j = 0; j < results.Length; j++)
                {
                    if (result == results[j])
                    {
                        count[j]++;
                    }
                }
            }

            return count;
        }
    }
}