#include <stdio.h>
int main(){
	int n,c[4]={};
  	char s[3];
  	char a[4][3]={"AC","WA","TLE","RE"};
  
  	scanf("%d",&n);
  	for(int i=0;i<n;i++){
    	scanf("%s",s);
      	if(s[0]=='A')
          	c[0]+=1;
      	else if(s[0]=='W')
          	c[1]+=1;
      	else if(s[0]=='T')
          	c[2]+=1;
      	else
          	c[3]+=1;
    }
  	for(int i=0;i<4;i++)
      printf("%s x %d\n",a[i],c[i]);
}