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