#include <bits/stdc++.h>
int main() {
  int a;
  int c = 0, w = 0, t = 0, r = 0;
  scanf("%d", &a);
  char b[a][10];
  for (int i = 0; i < a; i++) {
    scanf("%s", b[i]);
  }
  for (int j = 0; j < a; j++) {
    if (b[j] == "AC")
      c = c + 1;
    else if (b[j] == "WA")
      w = w + 1;
    else if (b[j] == "TLE")
      t = t + 1;
    else
      r = r + 1;
  }
  printf("AC x %d\n", c);
  printf("WA x %d\n", w);
  printf("TLE x %d\n", t);
  printf("RE x %d\n", r);
  return 0;
}
