#include <bits/stdc++.h>
int main(void) {
  long n, i, m = 0, p = 0, k = 0, o = 0;
  char c[3];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%s", c);
    if (strcmp("AC", c) == 0) {
      m++;
    } else if (strcmp("WA", c) == 0) {
      p++;
    } else if (strcmp("TEL", c) == 0) {
      k++;
    } else if (strcmp("RE", c) == 0) {
      o++;
    }
  }
  printf("AC x %ld\n", m);
  printf("WA x %ld\n", p);
  printf("TLE x %ld\n", k);
  printf("RE x %ld\n", o);
  return 0;
}
