#include <bits/stdc++.h>

using namespace std;

int C1,C2,C3,C4,N;
vector<string>S;
int main()
{
    cin>>N;
    while(N--)
    {
        string s;
        cin>>s;
        S.push_back(s);
    }
    for(int i=0; i<S.size(); ++i)
    {
        if(S[i] == "AC")++C1;
        else
            if(S[i] == "WA")++C2;
        else
            if(S[i] == "TLE")++C3;
        else
            if(S[i] == "RE")++C4;
    }
    cout<<"AC x "<<C1<<"\n";
    cout<<"WA x "<<C2<<"\n";
    cout<<"TLE x "<<C3<<"\n";
    cout<<"RE x "<<C4<<"\n";
    return 0;
}
