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