#include <bits/stdc++.h>
int main(void) {
  int cnt[4] = {0, 0, 0, 0};
  int n, i;
  char ac[] = "AC", tle[] = "TLE", wa[] = "WA", re[] = "RE";
  char judge[4];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%s", judge);
    if (strcmp(ac, judge) == 0) {
      cnt[0] += 1;
    } else if (strcmp(tle, judge) == 0) {
      cnt[1] += 1;
    } else if (strcmp(wa, judge) == 0) {
      cnt[2] += 1;
    } else if (strcmp(wa, judge) == 0) {
      cnt[3] += 1;
    }
  }
  printf("AC x %d\n", cnt[0]);
  printf("TLE x %d\n", cnt[1]);
  printf("WA x %d\n", cnt[2]);
  printf("RE x %d\n", cnt[3]);
  return 0;
}
