#include <stdio.h>
int main(void){
    // Your code here!
    int N;
    char num[4] = {};
    char str[10];
    
    scanf("%d",&N);
    
    for(int i = 0; i < N; i++){
        scanf("%9s",str);
        if(strcmp(str,"AC") == 0){
            num[0]++;
        }
        else if(strcmp(str,"WA") == 0){
            num[1]++;
        }
        else if(strcmp(str,"TLE") == 0){
            num[2]++;
        }
        else if(strcmp(str,"RE") == 0){
            num[3]++;
        }
    }
    
    printf("AC x %d\n",num[0]);
    printf("WA x %d\n",num[1]);
    printf("TLE x %d\n",num[2]);
    printf("RE x %d\n",num[3]);
}
