#include <bits/stdc++.h>
int main(void) {
  int num;
  scanf("%d", num);
  int count[4] = {0};
  for (int i = 0; i < num; i++) {
    char input[4];
    scanf("%s", input);
    if (strcmp(input, "AC") == 0) {
      count[0]++;
    } else if (strcmp(input, "WA") == 0) {
      count[1]++;
    } else if (strcmp(input, "TLE") == 0) {
      count[2]++;
    } else if (strcmp(input, "RE") == 0) {
      count[3]++;
    }
  }
  printf("AC x %d\n", count[0]);
  printf("WA x %d\n", count[0]);
  printf("TLE x %d\n", count[0]);
  printf("RE x %d", count[0]);
}
