#include <stdio.h>
#include <string.h>
char x[10];
int a,w,t,r;
int main(){
	int n,i;
	scanf("%d",&n);
	while(n--){
		scanf("%s",x);
		if(s[0]=='A')a++;
		else if(s[0]=='W')w++;
		else if(s[0]=='T')t++;
		else if(s[0]=='R')r++;
	}
	printf("AC x %d\n",a);
	printf("WA x %d\n",w);
	printf("TLE x %d\n",t);
	printf("RE x %d\n",r);
	return 0;
}