#include <bits/stdc++.h>
int main() {
  int countAC = 0, countWA = 0, countTLE = 0, countRE = 0;
  int n;
  scanf("%d", &n);
  char mystring[n][3];
  for (int i = 0; i < n; i++) {
    scanf("%s", mystring[i]);
  }
  for (int i = 0; i < n; i++) {
    if (strcmp("AC", mystring[i]) == 0) {
      countAC++;
    } else if (strcmp("WA", mystring[i]) == 0) {
      countWA++;
    } else if (strcmp("TLE", mystring[i]) == 0) {
      countTLE++;
    } else if (strcmp("RE", mystring[i]) == 0) {
      countRE++;
    } else {
      continue;
    }
  }
  printf("AC x %d \n", countAC);
  printf("WA x %d \n", countWA);
  printf("TLE x %d \n", countTLE);
  printf("RE x %d \n", countRE);
  return 0;
}
