using System;

namespace atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
           int N = int.Parse(Console.ReadLine());

            int[] ans = new int[4];

            string AC = "AC X";
            string WA = "WA X";
            string TEL = "TEL X";
            string RE = "RE X";

            for (int i = 0; i < N; i++)
            {
               string Input = Console.ReadLine().Replace("\r\n","");
                switch (Input)
                {
                    case ("AC"):
                        {
                            ans[0]++;break;                       }
                    case ("WA"):
                        {
                            ans[1]++; break;
                        }
                    case ("TEL"):
                        {
                            ans[2]++; break;
                        }
                    case ("RE"):
                        {
                            ans[3]++; break;
                        }
                }
              }

            Console.WriteLine(AC+" " +ans[0]);
            Console.WriteLine(WA + " " + ans[1]);
            Console.WriteLine(TEL + " " + ans[2]);
            Console.WriteLine(RE + " " + ans[3]);
        }
    }
}
