#include <bits/stdc++.h>
int main() {
  char S[3];
  int AC = 0, WA = 0, TLE = 0, RE = 0;
  unsigned int num;
  scanf("%d", &num);
  for (int i = 0; i < num; i++) {
    scanf("%s", S);
    if (strcmp(S, "AC") == 0) {
      AC = AC + 1;
    }
    if (strcmp(S, "WA") == 0) {
      WA++;
    }
    if (strcmp(S, "TLE") == 0) {
      TLE++;
    }
    if (strcmp(S, "RE") == 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);
}
