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

namespace ForAtcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            long n = long.Parse(Console.ReadLine());
            long ac = 0;
            long wa = 0;
            long tle = 0;
            long re = 0;
            for (var i = 1; i <= n; i++)
            {
                string tmp = Console.ReadLine();
                switch (tmp)
                {
                    case "AC":
                        ac++;
                        break;
                    case "WA":
                        wa++;
                        break;
                    case "TLE":
                        tle++;
                        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}");
            }
        }
    }
}