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