#include <stdio.h>
int main(void){
    int N,A=0,W=0,T=0,R=0;
    scanf("%d",&N);
    char txt[3];
    for(int i = 0;i < N;i++){
        gets(txt);
        char s = txt;
        if(s == "A"){
            A++;
        }else if(s == "W"){
            W++;
        }else if(s = "T"){
            T++;
        }else if(s == "R"){
            R++;
        }
    }
    printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d",A,W,T,R);
    return 0;
}