#include<stdio.h>
void main(){
    int n=0;
    int ac,wa,tle,re;
    ac=0;
    wa=0;
    tle=0;
    re=0;
    scanf("%d",&n);
    
    for(int i=0;i<n;i++){
        char input[5];
        scanf("%s",input);
        if(!strcmp(input,"AC"))ac++;
        if(!strcmp(input,"WA"))wa++;
        if(!strcmp(input,"TLE"))tle++;
        if(!strcmp(input,"RE"))re++;
    }
    printf("AC x %d\nWA x %d\nTHE x %d\nRE x %d\n",ac,wa,tle,re);
}