#include <bits/stdc++.h>
int check(char *str1, char *str2) {
  while (*str1 != '\0' && *str2 != '\0') {
    if (*str1++ != *str2++) return 0;
  }
  return 1;
}
int main(void) {
  int n;
  int c[4] = {0};
  char str[4];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", str);
    if (check(str, "AC"))
      c[0]++;
    else if (check(str, "WA"))
      c[1]++;
    else if (check(str, "TLE"))
      c[2]++;
    else if (check(str, "RE"))
      c[3]++;
  }
  printf("AC x %d\n", c[0]);
  printf("WA x %d\n", c[1]);
  printf("LTE x %d\n", c[2]);
  printf("RE x %d\n", c[3]);
  return 0;
}
