#include <bits/stdc++.h>
int c0, c1, c2, c3;
int main() {
  int n;
  scanf("%d", &n);
  char s[10];
  for (int i = 0; i < n; ++i) {
    scanf("%s", s);
    if (strcmp(s, "AC"))
      c0++;
    else if (strcmp(s, "WA"))
      c1++;
    else if (strcmp(s, "TLE"))
      c2++;
    else if (strcmp(s, "RE"))
      c3++;
  }
  printf("AC x %d\n", c0);
  printf("WA x %d\n", c1);
  printf("TLE x %d\n", c2);
  printf("RE x %d\n", c3);
  return 0;
}
