#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
   
    int n;
   cin >> n;
   string s;
   int a,b,c,d=0;

    rep(i,n){
        cin >> s;
        if(s[0]=='A') a++;
        else if (s[0]=='W') b++;
        else if (s[0]=='T') c++;
        else  d++;
    }

    cout<<"AC x "<<a<<endl<<"WA x "<<w<<endl<<"TLE x "<<t<<endl<<"RE x "<<r<<endl;
 return 0;
}