#include <bits/stdc++.h>
int main(void) {
  char buffer[4096], *p;
  size_t i = 0;
  int ac_count = 0;
  int wa_count = 0;
  int tle_count = 0;
  int re_count = 0;
  if (scanf("%4095[\x01-\xff]", buffer) != 1) {
    return 1;
  }
  for (i = 0, p = strtok(buffer, "\n"); p; ++i, p = strtok(NULL, "\n")) {
    if (strcmp(p, "AC") == 0) {
      ac_count++;
    }
    if (strcmp(p, "WA") == 0) {
      wa_count++;
    }
    if (strcmp(p, "TLE") == 0) {
      tle_count++;
    }
    if (strcmp(p, "RE") == 0) {
      re_count++;
    }
  }
  printf("AC x %d\n", ac_count);
  printf("WA x %d\n", wa_count);
  printf("TLE x %d\n", tle_count);
  printf("RE x %d\n", re_count);
  return 0;
}
