#include <bits/stdc++.h>

using namespace std;

int cnt[4];

int main() {
    int n; cin >> n;
    while (n--) {
        string str; cin >> str;
        if (str == 'AC') cnt[0]++;
        if (str == 'WA') cnt[1]++;
        if (str == 'TLE') cnt[2]++;
        if (str == 'RE') cnt[3]++;
    }
    cout << "AC x " << cnt[0] << endl;
    cout << "WA x " << cnt[1] << endl;
    cout << "TLE x " << cnt[2] << endl;
    cout << "RE x " << cnt[3] << endl;
}
