#include <bits/stdc++.h>

int main(){
    int N,
        ac = 0,
        wa = 0,
        tle = 0,
        re = 0;
    string s[100000];
    cin >> N;
    for (int i = 0; i < N; i++){
        cin >> s[i];
        if (s[i] == "AC"){
            ac++;
        }else if(s[i] == "WA"){
            wa++;
        }else if(s[i] == "TLE"){
            tle++;
        }else if(s[i] == "RE"){
            re++;
        }
    }
    std::cout << "AC x " << ac << endl;
    std::cout << "WA x " << wa << endl;
    std::cout << "TLE x " << tle << endl;
    std::cout << "RE x " << re << endl;
}
