#include <bits/stdc++.h>
int main() {
  int n;
  int ac, wa, tle, re;
  ac = wa = tle = re = 0;
  char s[10000 + 1][3 + 1];
  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) {
      ac++;
    } else if (strcmp(s[i], "WA") == 0) {
      wa++;
    } else if (strcmp(s[i], "TLE") == 0) {
      tle++;
    } else if (strcmp(s[i], "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);
}
