using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp5
{
    class Program
    {

        static void Main(string[] args)
        {
            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.Equals("AC"))
                {
                    ac++;
                }
                else if (S.Equals("WA"))
                {
                    wa++;
                }
                else if (S.Equals("TLE"))
                {
                    tle++;
                }
                else if (S.Equals("re"))
                {
                    re++;
                }
            }

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

        }
    }
}