#include <bits/stdc++.h>
int main() {
  int i, N, c0, c1, c2, c3;
  char *buf;
  char *AC = "AC";
  char *WA = "WA";
  char *TLE = "TLE";
  char *RE = "RE";
  c0 = c1 = c2 = c3 = 0;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%s", buf);
    if (strcmp(buf, AC) == 0) {
      c0++;
    } else if (strcmp(buf, WA) == 0) {
      c1++;
    } else if (strcmp(buf, TLE) == 0) {
      c2++;
    } else if (strcmp(buf, RE) == 0) {
      c3++;
    }
  }
  printf("AC x %d\n", c0);
  printf("WA x %d\n", c1);
  printf("TLE x %d\n", c2);
  printf("RE x %d\n", c3);
  return 0;
}
