using System;

namespace ABC173B
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine().Trim());
            int ac = 0;
            int tle = 0;
            int wa = 0;
            int re = 0;
            for(int i=0;i<N;i++) {
                var t = Console.ReadLine();
                switch(t){
                    case "AC": ac++; break;
                    case "TLE": tle++; break;
                    case "WA": wa++; break;
                    case "RE": re++; break;
                }
            }
            Console.WriteLine($"AC X {ac}");
            Console.WriteLine($"WA X {wa}");
            Console.WriteLine($"TLE X {tle}");
            Console.WriteLine($"RE X {re}");
        }
    }
}
