
#include <iostream>
#include <vector>
#include <set>
#include <list>
#include <map>
#include <string>
#include <algorithm>

void b(std::istream& in)
{
    int N;
    in >> N;

    int countAC = 0;
    int countWA = 0;
    int countTLE = 0;
    int countRE = 0;
    for (int i = 0; i < N; ++i)
    {
        std::string result;
        in >> result;
        if (result == "AC")
        {
            ++countAC;
        }
        else if (result == "WA")
        {
            ++countWA;
        }
        else if (result == "TLE")
        {
            ++countTLE;
        }
        else if (result == "RE")
        {
            ++countRE;
        }
        else
        {
            assert(false);
        }
    }

    std::cout << "AC x " << countAC << std::endl;
    std::cout << "WA x " << countWA << std::endl;
    std::cout << "TLE x " << countTLE << std::endl;
    std::cout << "RE x " << countRE;
}

int main(int, char* [])
{
    b(std::cin);
    return 0;
}

