using Microsoft.VisualBasic.CompilerServices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.ComTypes;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int input = int.Parse(Console.ReadLine());
            Dictionary<string, int> ans = new Dictionary<string, int>()
            {
                { "AC",0},
                { "WA",0},
                { "TLE",0},
                { "RE",0}
            };

            for(int i = 0;i< input; i++)
            {
                string jedge = Console.ReadLine();
                ans[jedge]++;
            }

            foreach(KeyValuePair<string,int> item in ans)
            {
                Console.WriteLine("{0} X {1}", item.Key, item.Value) ;
            }
        }
    }
}
