using System;

namespace Atcoder001
{
    class Program
    {
        static void Main(string[] args)
        {
            int amount = int.Parse(Console.ReadLine());
            string[] answers = new string[amount];
            for(int i = 0; i < amount; i++)
            {
                answers[i] = Console.ReadLine();
            }

            int[] count = new int[4];
            foreach(string answer in answers)
            {
                if(answer.Equals("AC"))
                {
                    count[0] += 1;
                }
                else if(answer.Equals("WA"))
                {
                    count[1] += 1;
                }
                else if (answer.Equals("TLE"))
                {
                    count[2] += 1;
                }
                else if (answer.Equals("RE"))
                {
                    count[3] += 1;
                }
            }
            
            Console.WriteLine("AC x " + count[0]);
            Console.WriteLine("WA x " + count[1]);
            Console.WriteLine("TLE x " + count[2]);
            Console.WriteLine("WA x " + count[3]);
        }
    }
}