#include <bits/stdc++.h>
int main() {
  int a = 0, b = 0, c = 0, d = 0;
  char line[8];
  int n;
  fgets(line, 8, stdin);
  sscanf(line, "%d", &n);
  for (int i = 1; i < n; i++) {
    char input[5];
    fgets(input, 5, stdin);
    if (strcmp(input, "AC") == 0) {
      a = a + 1;
    }
    if (strcmp(input, "WA") == 0) {
      b = b + 1;
    }
    if (strcmp(input, "TLE") == 0) {
      c = c + 1;
    }
    if (strcmp(input, "RE") == 0) {
      d = d + 1;
    }
  }
  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;
}
