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

#define maxn 100010

typedef long long ll;
typedef long double ld;
const int MAXI=INT_MAX;
const ll MAXL=LLONG_MAX;

int n;
string s;
map <string, int> dd;

int main(){
    //freopen("TASK.inp","r",stdin);
   // freopen("TASK.out","w",stdout);
    ios_base::sync_with_stdio(0);

    cin >> n;

    for (int i = 1; i <= n; i++){
        cin >> s;
        dd[s]++;
    }

    cout << "AC" << " " << "x" << " " << dd["AC"] << '\n';
    cout << "WA" << " " << "x" << " " << dd["WA"] << '\n';
    cout << "TLE" << " " << "x" << " " << dd["TLE"] << '\n';
    cout << "RE" << " " << "x" << " " << dd["RE"] << '\n';


    return 0;
}
