#include <bits/stdc++.h>
using namespace std;

int main(){
    int N;
    cin >> N;
    vector<int> name(N);
    for (int i=0;i<N;i++){
        cin >> name.at(i);
    }
    int c0=0,c1=0,c2=0,c3=0;
    for (int i=0;i<N;i++){
        if (name.at(i)=="AC"){
            c0++;
        }
        if (name.at(i)=="WA"){
            c1++;
        }
        if (name.at(i)=="TLE"){
            c2++;
        }
        if (name.at(i)=="RE"){
            c3++;
        }
    }
    cout << "AC x " << c0 << endl;
    cout << "WA x " << c1 << endl;
    cout << "TLE x " << c2 << endl;
    cout << "RE x " << c3 << endl;
}