#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int a[4] = {0, 0, 0, 0};
  char str[11100][40];
  for (int i = 0; i < n; i++) {
    scanf("%s", str[i]);
    if (strncmp(str[i], "AC", 2) == 0) a[0]++;
    if (strncmp(str[i], "WA", 2) == 0) a[1]++;
    if (strlen(str[i]) == 3)
      if (strncmp(str[i], "TLE", 3) == 0) a[2]++;
    if (strncmp(str[i], "RE", 2) == 0) a[3]++;
  }
  printf("AC x %d\n", a[0]);
  printf("WA x %d\n", a[1]);
  printf("TLE x %d\n", a[2]);
  printf("RE x %d\n", a[3]);
  return 0;
}
