#include <bits/stdc++.h>
int main() {
  int cc;
  scanf("%d", &cc);
  int AC = 0, TLE = 0, WA = 0, RE = 0;
  for (int i = 0; i < cc; i++) {
    char k[100];
    scanf("%s", k);
    if (k[0] == 'A') {
      AC++;
    }
    if (k[0] == 'T') {
      TLE++;
    }
    if (k[0] == 'W') {
      WA++;
    } else if (k[0] == 'R') {
      RE++;
    }
  }
  printf(" AC x %d\n", AC);
  printf(" TLE x %d\n", TLE);
  printf(" WA x %d\n", WA);
  printf(" RE x %d\n", RE);
  return 0;
}
