#include <bits/stdc++.h>
int main(void) {
  int n, i, ans, ac, wa, tle, re;
  ac = 0;
  wa = 0;
  tle = 0;
  re = 0;
  char *s1 = "AC";
  char *s2 = "WA";
  char *s3 = "TLE";
  char *s4 = "RE";
  char input[256];
  fgets(input, 256 - 1, stdin);
  sscanf(input, "%d", &n);
  for (i = 0; i < n; i++) {
    sscanf(input, "%d", &ans);
    char *ans = ans;
    if (strcmp(s1, ans) == 0) {
      ac++;
    } else if (strcmp(s2, ans) == 0) {
      wa++;
    } else if (strcmp(s2, ans) == 0) {
      tle++;
    } else {
      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;
}
