#include <iostream>
using namespace std;

int main()
{





   int N,C0=0,C1=0,C2=0,C3=0;
cin>>N;
string s[N];

for(int i=0;i<N;i++)
{ cin>>s[i];
if(s[i]=='AC')
    C0++;
    else if(s[i]=='WA')
        C1++;
    else if(s[i]=='TLE')
        C2++;
    else if(s[i]=='RE')
        C3++;

}

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