#include <iostream>
using namespace std;
int main(void){
    int n, a, w, t, r;
    string c[n];
    cin >> n;
    for(int z=0;z<n;z++){
        cin>>c[z];
    }
    for(z=0;z<n;z++){
        if(c[z]=="AC"){
            a+=1;
        }
        if else(c[z]=="WA"){
            w+=1;
        }
        if else(c[z]=="TLE"){
            t+=1;
        }
        else{
            r+=1;
        }
    }
    cout<<"AC x "<<a<<endl;
    cout<<"WA x "<<a<<endl;
    cout<<"TLE x "<<t<<endl;
    cout<<"RE x "<<r<<endl;
    
}
