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

int main(void) {
  int N;
  char** s;
  
  scanf("%d", &N);
  for (int i=0; i<N; i++) {
    scanf("%d", &s[i]);
  }
  
  int AC, WA, TLE, RE;
  AC=WA=TLE=RE=0;
  
  for (int i=0; i<N; i++) {
    switch(s[i]) {
      case "AC":
        AC+=1; break;
      case "WA":
        WA+=1; break;
      case "TLE":
        TLE+=1; break;
      case "RE":
        RE+=1; break;
    }
  }
  
  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;
}