#include <bits/stdc++.h>
int main() {
  int n, acN = 0, waN = 0, tleN = 0, reN = 0;
  const char ac[3] = "AC", wa[3] = "WA", tle[4] = "TLE", re[3] = "RE",
             judge[4] = "";
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", judge);
    if (judge == ac) {
      acN++;
      continue;
    }
    if (judge == wa) {
      waN++;
      continue;
    }
    if (judge == tle) {
      tleN++;
      continue;
    }
    if (judge == re) {
      reN++;
      continue;
    }
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", acN, waN, tleN, reN);
  return 0;
}
