#include<bits/stdc++.h>
using namespace std;
int main()
{
    int N,i,co1=0,co2=0,co3=0,co0=0;
    string S;
    cin>>N;
    for(i=0;i<n;i++)
    {
        cin>>S;
        if(S[0]=='A')
        {
            co0++;
        }
        else if(S[0]=='W')
        {
            co1++;
        }
        else if(S[0]=='T')
        {
            co2++;
        }
        else
        {
            co3++;

        }
    }
    cout<<"AC X "<<co0<<endl;
    cout<<"WA X "<<co1<<endl;
    cout<<"TLE X "<<co2<<endl;
    cout<<"RE X "<<co3<<endl;
    return 0;
}
