#include <bits/stdc++.h>
int main(void) {
  int n, a = 0, b = 0, c = 0, d = 0, i;
  char s;
  char *s1 = "AC";
  char *s2 = "WA";
  char *s3 = "TLE";
  char *s4 = "RE";
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%s", &s);
    if (strcmp(s1, &s) == 0)
      a++;
    else if (strcmp(s2, &s) == 0)
      b++;
    else if (strcmp(s3, &s) == 0)
      c++;
    else if (strcmp(s4, &s) == 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;
}
