#include <iostream>
using namespace std;
int main(){
    int n;
    int a = 0;
    int w = 0;
    int t = 0;
    int r = 0;
    cin >> n;
    for (i = 1; i <= n; i++){
        cin >> s;
        if(s == "AC"){
            a++
        }
        else if (s == "WA"){
            w++
        }
        else if (s == "TLE"){
            t++
        }
        else (s == "RE"){
            r++
        }
        cout << "AC x " << a << endl;
        cout << "WA x " << w << endl;
        cout << "TLE x " << t << endl;
        cout << "RE x " << r << endl;
    }
    return 0;
}