#include <stdio.h>

int main(){
  int a;
  char input[4];
  int ac = 0; wa = 0; tle = 0; re = 0;
  scanf("%d", &a);
  for(int i = 0; i < a; i++){
    gets(input);
    if(strcmp(input, "AC") == 0)
      ac++;
    else if(strcmp(input, "WA") == 0)
      wa++;
    else if(strcmp(input, "TLE") == 0)
      tle++;
    else if(strcmp(input, "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;
}