#include <bits/stdc++.h>
int main() {
  int n, ac = 0, wa = 0, tle = 0, re = 0;
  char s[10000][10];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", s[i]);
    if (strncmp(s[i], "AC", 2) == 0) ac++;
    if (strncmp(s[i], "WA", 2) == 0) wa++;
    if (strncmp(s[i], "TLE", 3) == 0) tle++;
    if (strncmp(s[i], "RE", 2) == 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;
}
