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

namespace B
{
    class Program
    {
        public static bool DEBUG = false;



        static void Main(string[] args)
        {
            do
            {
                Output.Sb.Clear();

                try
                {
                    Solve();
                    Console.WriteLine(Output.Sb.ToString());
                }
                catch (Exception e)
                {
                    Console.Error.WriteLine(e);
                }

            } while (DEBUG);
        }

        // 回答
        private static void Solve()
        {
            Input.Get(out int N);

            var cnts = new Dictionary<string, int>()
            {
                {"AC" , 0 },
                {"WA" , 0 },
                {"TLE", 0 },
                {"RE" , 0 }
            };
            for(int n = 0; n < N; n++)
            {
                Input.Get(out string Sn);

                cnts[Sn] += 1;
            }

            Output.AppendLine($"AC x {cnts["AC"]}");
            Output.AppendLine($"WA x {cnts["WA"]}");
            Output.AppendLine($"TLE x {cnts["TLE"]}");
            Output.AppendLine($"RE x {cnts["RE"]}");

        }


    }

    // 入力
    static class Input
    {
        public static void Get(out string in1)
        {
            in1 = Console.ReadLine();
        }

        public static void Get(out int in1)
        {
            in1 = int.Parse(Console.ReadLine());
        }

        public static void Get(out int in1, out int in2)
        {
            var arn = Console.ReadLine().Split(' ').Select(str => int.Parse(str)).ToArray();
            in1 = arn[0];
            in2 = arn[1];
        }

        public static void Get(out int in1, out int in2, out int in3)
        {
            var arn = Console.ReadLine().Split(' ').Select(str => int.Parse(str)).ToArray();
            in1 = arn[0];
            in2 = arn[1];
            in3 = arn[2];
        }

        public static void Get(out string[] in1)
        {
            in1 = Console.ReadLine().Split(' ');
        }

        public static void Get(out int[] in1)
        {
            in1 = Console.ReadLine().Split(' ').Select(str => int.Parse(str)).ToArray();
        }

        public static void Get(out List<string> in1)
        {
            in1 = Console.ReadLine().Split(' ').ToList();
        }

        public static void Get(out List<int> in1)
        {
            in1 = Console.ReadLine().Split(' ').Select(str => int.Parse(str)).ToList();
        }

    }

    // 出力用StringBuilder拡張メソッド
    static class Output
    {
        public static StringBuilder Sb { get; } = new StringBuilder();

        public static void AppendLine(string value)
        {
            Sb.AppendLine(value);
        }

        public static void AppendLine(int value)
        {
            Sb.AppendLine(value.ToString());
        }

        public static void AppendDebug<T>(string title, T[] arr)
        {
            if (!Program.DEBUG)
            {
                return;
            }

            Sb.AppendLine($"{title}[{arr.Length}]");

            Sb.AppendLine($"[{string.Join(", ", arr.Select(item => item.ToString()))}]");

            Sb.AppendLine();
        }

        public static void AppendDebug<T>(string title, T[][] arr)
        {
            if (!Program.DEBUG)
            {
                return;
            }

            Sb.AppendLine($"{title}[{arr.Length}][{(arr.Length > 0 ? arr[0].Length : 0)}]");

            foreach (var row in arr)
            {
                Sb.AppendLine($"[{string.Join(", ", row.Select(item => item.ToString()))}]");
            }


            Sb.AppendLine();
        }
    }
}


Measured memory_bytes: 30948