#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, n) for(int i=a; i<n; ++i)

void solve() {
    int t; cin>>t;
    int a = 0, b=0, c=0, d=0;
    rep(i, 0, n) {
        string s; cin>>s;
        if(s == "AC")
            a++;
        else if (s == "WA")
            b++;
        else if (s == "TLE")
            c++;
        else
            d++;
    }
    cout << "AC x " << a << "\n";  
    cout << "WA x " << b << "\n";  
    cout << "TLE x " << c << "\n";  
    cout << "RE x " << d << "\n";  

}

int main() {
    int t = 1; //scanf("%d", &t);
    while(t--) {
        solve();
    }
    return 0;
}
