#include <stdio.h>
#include <string.h>
int main(){
int n;
scanf("%d",&n);
char judge[n]={};
int ac=0,tle=0,wa=0,re=0;
for(int i=0;i<n;i++){
	scanf("%s",judge);
	if(strcmp(judge,"AC")==0){
		ac++;
	}
	else if(strcmp(judge,"TLE")==0){
		tle++;
	}
	else if(strcmp(judge,"WA")==0){
		wa++;
	}
	else if(strcmp(judge,"RE")==0){
		re++;
	}
}

printf("AC x %d\n",ac);
printf("WA x %d\n",wa);
printf("TLE x %d\n",tle);
printf("RE x %d\n",re);
return 0;
}