#include <bits/stdc++.h>
int main() {
  int a, ac = 0, wa = 0, tle = 0, re = 0;
  char huruf[10];
  scanf("%d", &a);
  for (int i = 0; i < a; i++) {
    scanf("%s", huruf);
    if (huruf[0] == 'A') {
      ac++;
    } else if (huruf[0] == 'W') {
      wa++;
    } else if (huruf[0] == 'T') {
      tle++;
    } else if (huruf[0] == 'R') {
      re++;
    }
  }
  printf("AC X %d\nWA X %d\nTLE x %d\nRE X %d\n", ac, wa, tle, re);
  return 0;
}
