#include<cstdio>

int N,a,b,c,d;
char s[10];
int main(){
    scanf("%d",&N);
    for(int i = 1; i <= N; ++i){
        scanf("%s",s);
        if(a[0] == 'A') ++a;
        else if(a[0] == 'W')    ++b;
        else if(a[0] == 'T')    ++c;
        else    ++d;
    }
    printf("AC x %d\n",a);
    printf("WA x %d\n",b);
    printf("TLE x %d\n",c);
    printf("RE x %d\n",d);
    return 0;
}