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