#include<bits/stdc++.h>
using namespace std;
int main()
{
    int N,i,C1=0,C2=0,C3=0,C0=0;
    string S;
    cin>>N;
    for(i=0;i<N;i++)
    {
        cin>>s;
        if(S[0]=='A')
        {
            C0++;
        }
        else if(S[0]=='W')
        {
            C1++;
        }
        else if(S[0]=='T')
        {
            C2++;
        }
        else
        {
            C3++;

        }
    }
    cout<<"AC X "<<C0<<endl;
    cout<<"WA X "<<C1<<endl;
    cout<<"TLE X "<<C2<<endl;
    cout<<"RE X "<<C3<<endl;
    return 0;
}
