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