#include <bits/stdc++.h>
int main(void) {
  int a;
  scanf("%d", &a);
  char *s[a];
  char *sta[4];
  sta[0] = "AC";
  sta[1] = "WA";
  sta[2] = "TLE";
  sta[3] = "RE";
  for (int i = 0; i < a; i++) {
    scanf("%s", &s[i]);
  }
  int ac = 0, wa = 0, tle = 0, re = 0;
  for (int i = 0; i < a; i++) {
    if (strcmp(sta[0], s[i]) == 0) ac++;
    if (strcmp(sta[1], s[i]) == 0) wa++;
    if (strcmp(sta[2], s[i]) == 0) tle++;
    if (strcmp(sta[3], s[i]) == 0) re++;
  }
  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;
}
