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