#include<bits/stdc++.h>

using namespace std;

int main(){
    int n;cin>>n;
    map <string,int> mapa,string x;
    for(int i=0;i<n;i++){
        cin >>x;
        mapa[x]++;
    }
    cout << "AC x "<<mapa["AC"]<<endl;
    cout << "WA x "<<mapa["WA"]<<endl;
    cout << "TLE x "<<mapa["TLE"]<<endl;
    cout << "RE x "<<mapa["RE"]<<endl;
}
