using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;

namespace Atcoder.Abc
{
    //https://atcoder.jp/contests/abc173/tasks/abc173_b
    public class Abc173_B
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            int C0 = 0;
            int C1 = 0;
            int C2 = 0;
            int C3 = 0;

            var N = int.Parse(ReadLine());

            for (int i = 1; i <= N; i++)
            {
                var S = ReadLine().ToString();

                switch (S)
                {
                    case "AC":
                        C0 += 1;
                        break;

                    case "WA":
                        C1 += 1;
                        break;

                    case "TLE":
                        C2 += 1;
                        break;

                    case "RE":
                        C3 += 1;
                        break;
                }
            }

            WriteLine($"AC x {C0}");
            WriteLine($"WA x {C1}");
            WriteLine($"TLE x {C2}");
            WriteLine($"RE x {C3}");



            Console.Out.Flush();
        }
    }
}
