#include <bits/stdc++.h>
int main() {
  char spell[127];
  int N, a = 0, w = 0, t = 0, r = 0;
  if (scanf("%d", &N)) {
    for (int i = 1; i <= N; i++) {
      if (scanf("%s", spell)) {
        if (strcmp(spell, "AC") == 0) {
          a += 1;
        } else if (strcmp(spell, "WC") == 0) {
          w += 1;
        } else if (strcmp(spell, "TLE") == 0) {
          t += 1;
        } else if (strcmp(spell, "RE") == 0) {
          r += 1;
        } else {
          continue;
        }
      }
    }
  }
  printf("AC x %d\n", a);
  printf("WC x %d\n", w);
  printf("TLE x %d\n", t);
  printf("RE x %d\n", r);
  return 0;
}
