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

int main(){
    int n;
    cin >> n;
    vector<string> s(n);
    int a = 0, w = 0, t = 0, r = 0;
    for(int i = 0; i < n; i++){
        cin >> s.at(i);
        if(s.at(i) == "AC") a++;
        else if(s.at(i) == "WA") w++;
        else if(s.at(i) == "TLE") t++;
        else r++;
    }
    cout << "AC x " << a"\n" << "WA x " << w"\n" << "TLE x " << t"\n" << "RE x " << r << endl;
}
