#include <bits/stdc++.h>
int main() {
  int n;
  char s[4];
  int a[4] = {0};
  scanf("%d", &n);
  while (n--) {
    scanf("%s", s);
    if (!strcmp(s, "AC")) a[0]++;
    if (!strcmp(s, "WA")) a[1]++;
    if (!strcmp(s, "TLE")) a[2]++;
    if (!strcmp(s, "RE")) a[3]++;
  }
  printf("AC X %d\n", a[0]);
  printf("WA X %d\n", a[1]);
  printf("TLE X %d\n", a[2]);
  printf("RE X %d\n", a[3]);
  return 0;
}
