#include <stdio.h>
#include <string.h>

int main(){
  char C[3];
  int AC=0;
  int WA=0;
  int TLE=0;
  int RE=0;
  int k=0;
  k = scanf("%d", &index);
  for (int i = 0; i < index; i++){
    k = scanf("%s", C);
    if (strcmp(C, "AC")==0){
      ++AC;
    }else if (strcmp(C, "WA")==0){
      ++WA;
    }else if (strcmp(C, "TLE")==0){
      ++TLE;
    }else{
      ++RE;
    }

  }

  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", AC, WA, TLE, RE);
  
  return 0;
}
