#include <bits/stdc++.h>
int main() {
  int N = 0, i = 0, C0 = 0, C1 = 0, C2 = 0, C3 = 0;
  char S;
  scanf("%d", &N);
  for (i; i < N; i++) {
    scanf("%s", &S);
    if (S == 'A') {
      C0 += 1;
    }
    if (S == 'W') {
      C1 += 1;
    }
    if (S == 'T') {
      C2 += 1;
    }
    if (S == 'R') {
      C3 += 1;
    }
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d", C0, C1, C2, C3);
  return 0;
}
