#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main (void){
    int n;
    char judge[100000];
    int AC,WA,TLE,RE;
    scanf("%d",&n);
    for(int i=0 ;i<n; i++){
        scanf("%s",judge[i])
    }
    for(int i=0 ;i<judge.length; i++){
        if(judge[i]=='AC'){
            AC++;
        }
        if(judge[i]=='WA'){
            WA++;
        }
        if(judge[i]=='TLE'){
            TLE++;
        }
        if(judge[i]=='RE'){
            RE++;
        }
    }
    printf("AC x %d\nWA X %d\nTLE x %d\nRE X %d\n",AC,WA,TLE,RE);
    return 0;
}