#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int i;
  char s[100000];
  int a = 0, b = 0, c = 0, d = 0;
  for (i = 0; i < n; i++) {
    scanf("%d", &s[i]);
  }
  for (i = 0; i < n; i++) {
    if (strncmp(&s[i], "A", 1) == 0) {
      a++;
    }
    if (strncmp(&s[i], "W", 1) == 0) {
      b++;
    }
    if (strncmp(&s[i], "T", 1) == 0) {
      c++;
    }
    if (strncmp(&s[i], "R", 1) == 0) {
      d++;
    }
  }
  printf("AC x %d\n", a);
  printf("WA x %d\n", b);
  printf("TLE x %d\n", c);
  printf("RE x %d\n", d);
  return 0;
}
