#include <bits/stdc++.h>
int main() {
  int x;
  char contain[100];
  int ac = 0, wa = 0, tle = 0, re = 0;
  scanf("%d", &x);
  for (int i = 0; i < x; i++) {
    scanf("%s", &contain);
    if (strcmp(contain, "AC") == 0) {
      ac = ac + 1;
    } else if (strcmp(contain, "WA") == 0) {
      wa = wa + 1;
    } else if (strcmp(contain, "TLE") == 0) {
      tle = tle + 1;
    } else if (strcmp(contain, "RE") == 0) {
      re = re + 1;
    }
  }
  printf("AC X %d\n", ac);
  printf("WA X %d\n", wa);
  printf("TLE X %d\n", tle);
  printf("RE X %d\n", re);
}
