#include <bits/stdc++.h>
int main(void) {
  int size;
  char n[4];
  int A = 0;
  int B = 0;
  int C = 0;
  int D = 0;
  scanf("%d", &size);
  for (int i = 0; i < size; i++) {
    scanf("%s", n);
    if (strcmp("AC", n) == 0) {
      A++;
    } else if (strcmp("WA", n) == 0) {
      B++;
    } else if (strcmp("TLE", n) == 0) {
      C++;
    } else if (strcmp("RE", n) == 0) {
      D++;
    }
  }
  printf("AC x　%d \n", A);
  printf("WA x %d \n", B);
  printf("TLE x %d \n", C);
  printf("RE x %d \n", D);
  return 0;
}
