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