using System;
using System.Linq;


class name
{
    static void Main()
    {

        int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray();
        string[] m= new string[100005];
        int[] h = new int[10];
        for(int k = 0; k < n[0]; k++)
        {
            m[k] = Console.ReadLine().Split().ToString();
            if (m[k] == "AC")
            {
                h[0] += 1;

            }
            else if (m[k] == "WA")
            {

                h[1] += 1;
            }
            else if (m[k] == "TLE")
            {
                h[2] += 1;

            }
            else
            {
                h[3] += 1;

            }

        }
        Console.WriteLine("AC×" + h[0] + "");
        Console.WriteLine("WA×" + h[1] + "");
        Console.WriteLine("TLE×" + h[2] + "");
        Console.WriteLine("RE×" + h[3] + "");

    }



}