#include <bits/stdc++.h>
int main() {
  int n;
  char s[5];
  int a[5] = {0};
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    if (strcmp(s, "AC"))
      a[0]++;
    else if (strcmp(s, "WA"))
      a[1]++;
    else if (strcmp(s, "TLE"))
      a[2]++;
    else
      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;
}
