#include <bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin>>n;
    int count[4]={};
    while(n--){
        string s;
        cin>>s;
        if(s=="AC"){
            count[0]++;
        }
        else if(s=="WA"){
            count[1]++:
        }
        else if(s=="TLE"){
            count[2]++;
        }
        else{
            count[3]++;
        }
    }
    cout<<"AC x "<<count[0]<<endl;
    cout<<"WA x "<<count[1]<<endl;
    cout<<"TLE x "<<count[2]<<endl;
    cout<<"RE x "<<count[3]<<endl;
    return 0;
}