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