#include<iostream>
#include<vector>
#include<string>
using namespace std;

int main(){
    int N;
    int count_AC = 0, count_WA = 0, count_TLE = 0, count_RE = 0;
    cin >> N;
    vector<string> S[N];
    for(int i = 0; i < N; i++) cin >> S[i];

    for(int i = 0; i < N; i++){

        if(S[i] == "AC") count_AC++;
        if(S[i] == "WA") count_WA++;
        if(S[i] == "TLE") count_TlE++;
        if(S[i] == "RE") count_RE++;

    }
    cout << "AC" << " x " << count_AC << endl;
    cout << "WA" << " x " << count_WA << endl;
    cout << "TLE" << " x " << count_TLE << endl;
    cout << "RE" << " x " << count_RE << endl;
}