include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N;
    cin >> N;

    vector<string> vec(N);

    for(int i = 0; i < N; i++){
        cin >> vec.at(i);
    }

    int a,b,c,d;
    a = 0;
    b = 0;
    c = 0;
    d = 0;

    for(int i = 0; i < N; i++){
        if(vec.at(i) == "AC"){
            a++;
        }
    }

    for(int i = 0; i < N; i++){
        if(vec.at(i) == "WA"){
            b++;
        }
    }

    for(int i = 0; i < N; i++){
        if(vec.at(i) == "TLE"){
            c++;
        }
    }

    for(int i = 0; i < N; i++){
        if(vec.at(i) == "RE"){
            d++;
        }
    }

    cout << "AC x " << a << endl;
    cout << "WA x " << b << endl;
    cout << "TLE x " << c << endl;
    cout << "RE x " << d << endl;

}