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