#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <functional>
#include <queue>
#include <math.h>
#include <cmath>
#include <unordered_map>

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;





// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<std::string> S(N);

    int cntAC=0;int cntWA=0;int cntTLE=0;int cntRE=0;

    for(int i = 0 ; i < N ; i++){
        std::cin >> S[i];
        if(S[i]=="AC"){
            cntAC++;
        }else if(S[i]=="WA"){
            cntWA++;
        }else if(S[i]=="TLE"){
            cntTLE++;
        }else if(S[i]=="RE"){
            cntRE++;
        }
    }
    cout<<"AC x "<<cntAC<<endl;
    cout<<"WA x "<<cntWA<<endl;
    cout<<"TLE x "<<cntTLE<<endl;
    cout<<"RE x "<<cntRE<<endl
    return 0;
}
