#include <bits/stdc++.h>
int main(void) {
  int accounter, wacounter, tlecounter, recounter = 0;
  int n;
  int num = 6;
  int i = 0;
  char N[5];
  scanf("%d", &n);
  while (i < num) {
    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++;
    }
    i++;
  }
  printf("AC x %d\n", accounter);
  printf("WA x %d\n", wacounter);
  printf("TLE x %d\n", tlecounter);
  printf("RE x %d\n", recounter);
}
