#include <bits/stdc++.h>
int main() {
  int a;
  scanf("%d", &a);
  char b[a + 1];
  int ac = 0, wa = 0, tle = 0, re = 0;
  for (int i = 0; i < a; i++) {
    scanf("%s", &b);
  }
  for (int j = 0; j < a; j++) {
    if (b[0] == 'A') {
      ac++;
    } else if (b[0] == 'W') {
      wa++;
    } else if (b[0] == 'T') {
      tle++;
    } else if (b[0] == 'R') {
      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;
}
