#include<stdio.h>
#include<string.h>
int main(void)
{
	int N;
	char a[20] = "AC";
	char b[20] = "WA";
	char c[20] = "TLE";
	char d[20] = "RE";
	int i;
	int ac = 0;
	int wa = 0;
	int tle = 0;
	int re = 0;
	char s[100];
	
	scanf("%d",&N);
	
	for( i = 0 ; i < N;i++)
	{
		scanf("%s",S);
		
		if(strcmp(S,a) == 0)
		{
			ac++;
		}
		else if(strcmp(S,b) == 0)
		{
			wa++;
		}
		else if(strcmp(S,c) == 0)
		{
			tle++;
		}
		else if(strcmp(S,d) == 0)
		{
			re++;
		}
	}
	
	printf("ACx%d\n",ac);
	printf("WAx%d\n",wa);
	printf("TLEx%d\n",tle);
    printf("REx%d\n",re);
    return 0;
}