#include <bits/stdc++.h>
int main() {
  int a, c = 0, d = 0, e = 0, f = 0;
  scanf("%d", &a);
  char ch[4];
  for (int i = 0; i < a; i++) {
    scanf("%s", ch);
    if (0 == (strcmp(ch, "AC")))
      c++;
    else if (0 == (strcmp(ch, "WA")))
      d++;
    else if (0 == (strcmp(ch, "TLE")))
      e++;
    else
      f++;
    memset(ch, '\0', sizeof(ch));
  }
  printf("AC x%d\n", c);
  printf("WA x%d\n", d);
  printf("TLE x%d\n", e);
  printf("RE x%d", f);
  return 0;
}
