#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t,w=0,t=0,r=0,a=0;
    cin>>t;
    while(t--)
    {
        string s;
        cin>>s;
        if(s[0]=='A')
        a++;
        else if(s[0]=='R')
        r++;
        else if(s[0]=='T')
        t++;
        else
        w++;
    }
    cout<<"AC x "<<a<<endl;
    cout<<"WA x "<<w<<endl;
    cout<<"TLE x "<<t<<endl;
    cout<<"RE x "<<r<<endl;
}