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


int main() {
    int N;
    string a[100000];
    cin >> N;
    rep(i, N) cin >> a[i];

    int res[4];
    rep(i, N) {
        if(a[i] == "AC") {
            res[0]++;
        } else if(a[i] == "WA") {
            res[1]++;
        } else if(a[i] == "TLE") {
            res[2]++;
        } else if(a[i] == "RE") {
            res[3]++;
        }
    }
    cout << "AC x " << res[0] << endl; 
    cout << "WA x " << res[1] << endl;
    cout << "TLE x " << res[2] << endl;
    cout << "RE x " << res[3] << endl;
}