#include<stdio.h>
int main(void){
  int N;
  scanf("%d",&N);
  int i,j;
  char s[4};
   int C0,C1,C2,C3;
  C0=0;
  C1=0;C2=0;C3=0;
  for(j=0;j<N;j++){{scanf("%s",&s);}for(i=0;i<10000;i++)if(s[i]=='\0'){break;}
 if(s[0]=='A'&&s[1]=='C'){C0=C0+1;}
  else if(s[0]=='W'&&s[1]=='A'){C1=C1+1;}
  else if(s[0]=='T'&&s[1]=='L'&&s[2]=='E'){C2=C2+1;}
  else if(s[0]=='R'&&s[1]=='E'){C3=C3+1;}}
    printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n",C0,C1,C2,C3);
  return 0;
}
  
