using System;
using System.Collections.Generic;

namespace AtCoderTest
{
    class Program
    {
        static void Main(string[] args)
        {
            var ac = 0;
            var tle = 0;
            var wa = 0;
            var re = 0;

            for (int i = 0; i < int.Parse(Read()); i++)
            {
                switch (Read())
                {
                    case "AC":
                        ac++; break;
                    case "TLE":
                        tle++; break;
                    case "WA":
                        wa++; break;
                    case "RE":
                        re++; break;
                    default:
                        break;
                }
            }

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

        }


        private static string Read() => Console.ReadLine();
        private static List<string> SplitRead(char delimiter = ' ')
        {
            var splitWord = new List<string>();
            var start = 0;
            var str = Console.ReadLine();

            for (int i = 0; i < str.Length; i++)
            {
                if (str[i] == delimiter)
                {
                    splitWord.Add(str[start..i]);
                    start = i + 1;
                }
            }
            return splitWord;
        }
    }
}
