
using System;
using System.Collections.Generic;

class IDONTKNOWCSHARP
{
    public static void Main()
    {
        int num=int.Parse(Console.ReadLine());
        int[] array=new int[4];
        array[0]=0;
        array[1]=0;
        array[2]=0;
        array[3]=0;

        for(int i = 0; i < num; i++)
        {
            switch (Console.ReadLine())
            {
                case "AC":array[0]++;break;
                case "WA":array[1]++;break;
                case "TLE":array[2]++;break;
                case "RE":array[3]++;break;
            }
        }

        Console.WriteLine($"AC x {array[0]}");
        Console.WriteLine($"WA x {array[1]}");
        Console.WriteLine($"TLE x {array[2]}");
        Console.WriteLine($"RE x　{array[3]}");

    }

}