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

namespace test1
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var list = new List<string>();
            for (int i = 0; i < N; i++)
            {
                list.Add(Console.ReadLine());
            }

            Console.WriteLine("AC x {0}", list.Where(x => string.Compare(x, "AC") == 0).Count());
            Console.WriteLine("WA x {0}", list.Where(x => string.Compare(x, "WA") == 0).Count());
            Console.WriteLine("TLE x {0}", list.Where(x => string.Compare(x, "TLE") == 0).Count());
            Console.WriteLine("REx {0}", list.Where(x => string.Compare(x, "RE") == 0).Count());

            return;
        }
    }
}
