#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
  int N,a=0,b=0,c=0,d=0,i;
  char in[4];
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scan("%s\n",in);
    if(strcmp(in,"AC")==0){
      a++;
    }else if(strcmp(in,"WA")==0){
      b++;
    }else if(strcmp(in,"TLE")==0){
      c++;
    }else if(strcmp(in,"RE")==0){
      d++;
    }
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d",a,b,c,d);
    return 0;
}