#include <bits/stdc++.h>
int main(void) {
  char nstr[7], jd[5];
  int n, i, count[4] = {0, 0, 0, 0};
  fgets(nstr, sizeof(nstr), stdin);
  sscanf(nstr, "%d", &n);
  for (i = 0; i < n; i++) {
    fgets(jd, sizeof(jd), stdin);
    if (strcmp(jd, "AC") == 0) {
      count[0]++;
    } else if (strcmp(jd, "WA") == 0) {
      count[1]++;
    } else if (strcmp(jd, "TLE") == 0) {
      count[2]++;
    } else if (strcmp(jd, "RE") == 0) {
      count[3]++;
    }
  }
  printf("AC x %d\n", count[0]);
  printf("WA x %d\n", count[1]);
  printf("TLE x %d\n", count[2]);
  printf("RE x %d\n", count[3]);
  return 0;
}
