using System;
using System.Collections.Generic;
using System.Linq;

namespace ProgramingStudying2
{
    class Program
    {

        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var ac = 0;
            var wa = 0;
            var tle = 0;
            var re = 0;

            for(int i = 0; i < n; i++)
            {
                var s = Console.ReadLine();
                if(s == "AC")
                {
                    ac++;
                }
                if (s == "WA")
                {
                    wa++;
                }
                if (s == "TLE")
                {
                    tle++;
                }
                if (s == "RE")
                {
                    re++;
                }
            }
            Console.WriteLine("AC x " + ac);
            Console.WriteLine("WA " + wa);
            Console.WriteLine("TLE x " + tle);
            Console.WriteLine("RE x " + re);
        }
    }
}
