#include <bits/stdc++.h>
int main() {
  int c;
  char str[10001][4];
  int ans[4];
  for (int i = 0; i < 4; i++) {
    ans[i] = 0;
  }
  scanf("%d", &c);
  for (int i = 0; i < c; i++) {
    scanf("%s", str[i]);
  }
  for (int i = 0; i < c; i++) {
    if (strcmp(str[i], "AC") == 0)
      ans[0]++;
    else if (strcmp(str[i], "WA") == 0)
      ans[1]++;
    else if (strcmp(str[i], "TLE") == 0)
      ans[2]++;
    else if (strcmp(str[i], "RE"))
      ans[3]++;
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", ans[0], ans[1], ans[2],
         ans[3]);
  return 0;
}
