#include<stdio.h>
int main()
{
    int N,i,AC=0,WA=0,TLE=0,RE=0;
	char kazu[3];
    scanf("%d",&N);
    for(i=0;i<N;i++)
    {
        scanf("%s",&kazu);
        if(!strcmp(kazu, "AC"))
        {
            AC++;
        }
        if(!strcmp(kazu,"WA"))
        {
            WA++;
        }
         if(!strcmp(kazu, "TLE"))
        {
            TLE++;
        }
         if(!strcmp(kazu, "RE"))
        {
            RE++;
        }
        
    }
printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d",AC,WA,TLE,RE);

return 0;
}