  int n;
  int ac,wa,re = 0;
  int TLE = 0;
  
  char *a = "AC";
  char *b = "WA";
  char *c = "TLE";
  char *d = "RE";
  char s[255];
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%s",s);
    if (strcmp(s,a)==0) {
      ac+=1;
    } else if (strcmp(s,b)==0) {
      wa+=1;
    } else if (strcmp(s,c)==0) {
      tle+=1;
    } else {
      re+=1;
    }
  }
  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;
}
    