#include <bits/stdc++.h>
int main() {
  int N;
  int ac_count = 0;
  int wa_count = 0;
  int tle_count = 0;
  int re_count = 0;
  scanf("%d", &N);
  char str[N];
  for (int i = 0; i < N; i++) {
    scanf("%s", &str[i]);
  }
  for (int j = 0; j < N; j++) {
    if (strcmp(&str[j], "AC") == 0) {
      ac_count++;
    } else if (strcmp(&str[j], "WA") == 0) {
      wa_count++;
    } else if (strcmp(&str[j], "TLE") == 0) {
      tle_count++;
    } else {
      re_count++;
    }
  }
  printf("AC x %d\n", ac_count);
  printf("WA x %d\n", wa_count);
  printf("TLE x %d\n", tle_count);
  printf("RE x %d\n", re_count);
  return 0;
}
