#include <bits/stdc++.h>
int main() {
  int n, a = 0, b = 0, c = 0, d = 0;
  char s[100000][3];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  for (int i = 0; i < n; i++) {
    if (strcmp(s[i], "AC") == 0) {
      a++;
    }
    if (strcmp(s[i], "WA") == 0) {
      b++;
    }
    if (strcmp(s[i], "TLE") == 0) {
      c++;
    }
    if (strcmp(s[i], "RE") == 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;
}
