#include <bits/stdc++.h>
int main() {
  int n;
  char ac = 0, wa = 0, tle = 0, re = 0;
  std::string s;
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    std::cin >> s;
    if (s == "AC") {
      ac++;
    }
    if (s == "WA") {
      wa++;
    }
    if (s == "TLE") {
      tle++;
    }
    if (s == "RE") {
      re++;
    }
  }
  printf("AC x %d\n", ac);
  printf("WA x %d\n", wa);
  printf("TLE x %d\n", tle);
  printf("RE x %d\n", re);
}
