#include <bits/stdc++.h>
int main() {
  int t;
  char sent[10];
  int num[4] = {0};
  scanf("%d", &t);
  while (t--) {
    scanf("%s", sent);
    if (strcmp(sent, "AC") == 0)
      num[0]++;
    else if (strcmp(sent, "WA") == 0)
      num[1]++;
    else if (strcmp(sent, "TLE") == 0)
      num[2]++;
    else if (strcmp(sent, "RE") == 0)
      num[3]++;
  }
  printf("AC x %d\n", num[0]);
  printf("AC x %d\n", num[1]);
  printf("AC x %d\n", num[2]);
  printf("AC x %d\n", num[3]);
  return 0;
}
