#include <bits/stdc++.h>
int main() {
  int N;
  char tmp;
  scanf("%d%c", &N, &tmp);
  int ac = 0, wa = 0, tle = 0, re = 0;
  char *s;
  for (int i = 0; i < N; i++) {
    fgets(s, 5, stdin);
    puts(s);
    if (!strcmp(s, "AC\n")) ac++;
    if (!strcmp(s, "WA\n")) wa++;
    if (!strcmp(s, "TLE\n")) tle++;
    if (!strcmp(s, "RE\n")) 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;
}
