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

class Program
{
    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        var ansl = new int[4] { 0, 0, 0, 0 };
        for (var i = 0; n > i; i++)
        {
            var l = Console.ReadLine();
            if (l == "AC") ansl[0]++;
            if (l == "WA") ansl[1]++;
            if (l == "TLR") ansl[2]++;
            if (l == "RE") ansl[3]++;
        }

        for (var i = 0; 4 > i; i++)
        {
            if (i == 0) Console.Write("AC");
            if (i == 1) Console.Write("WA");
            if (i == 2) Console.Write("TLE");
            if (i == 3) Console.Write("RE");
            Console.WriteLine($" x {ansl[i]}");
        }
    }
}