using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace atcoder172
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = long.Parse(Console.ReadLine());

            var acCnt = 0;
            var waCnt = 0;
            var tleCnt = 0;
            var reCnt = 0;

            for (var i = 0; i < n; i++)
            {
                var resultStr = Console.ReadLine();

                switch (resultStr)
                {
                    case "AC":
                        acCnt++;
                        break;
                    case "WA":
                        waCnt++;
                        break;
                    case "TLE":
                        tleCnt++;
                        break;
                    case "RE ":
                        reCnt++;
                        break;
                }
            }

            Console.WriteLine($"AC x {acCnt}");
            Console.WriteLine($"WA x {waCnt}");
            Console.WriteLine($"TLE x {tleCnt}");
            Console.WriteLine($"RE x {reCnt}");
        }
    }
}