#include <bits/stdc++.h>
int main() {
  int n;
  int AC = 0;
  int WA = 0;
  int TLE = 0;
  int RE = 0;
  char kata[12];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", &kata[i]);
    for (int i = 0; i < n; i++) {
      if (kata[i] == 'A') {
        AC++;
        continue;
      } else if (kata[i] == 'W') {
        WA++;
        continue;
      } else if (kata[i] == 'T') {
        TLE++;
        continue;
      } else if (kata[i] == 'R') {
        RE++;
        continue;
      }
    }
  }
  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;
}
