#include <bits/stdc++.h>
int main() {
  char ac = 0, wa = 0, tle = 0, re = 0;
  int N;
  do {
    scanf("%d", &N);
  } while (N < 0);
  char data[1000][10], i = 0;
  while (i < N) {
    do {
      scanf("%s", data[i]);
    } while (data[i] == NULL);
    i++;
  }
  for (i = 0; i < N; i++) {
    if (strcmp(data[i], "AC") == 0) {
      ac++;
    } else if (strcmp(data[i], "WA") == 0) {
      wa++;
    } else if (strcmp(data[i], "TLE") == 0) {
      tle++;
    } else if (strcmp(data[i], "RE") == 0) {
      re++;
    }
  }
  printf("AC x %d\n", ac);
  printf("WA x %d\n", wa);
  printf("TLE x %d\n", tle);
  printf("RE x %d\n", re);
  return 0;
}
