#include <bits/stdc++.h>
int main() {
  int N, ac = 0, wa = 0, tle = 0, re = 0, i;
  char *result;
  char str1[] = "AC", str2[] = "WA", str3[] = "TLE", str4[] = "RE";
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%s", result);
    if (strcmp(result, str1) == 0) ac++;
    if (strcmp(result, str2) == 0) wa++;
    if (strcmp(result, str3) == 0) tle++;
    if (strcmp(result, str4) == 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;
}
