#include <bits/stdc++.h>
int main(void) {
  int n;
  std::cin >> n;
  int a, b, c, d;
  std::string str;
  for (int i = 0; i < n; i++) {
    std::cin >> str;
    if (str == "AC") {
      a++;
    } else if (str == "WA") {
      b++;
    } else if (str == "TLE") {
      c++;
    } else {
      d++;
    }
  }
  std::cout << "AC x " << a << std::endl;
  std::cout << "WA x " << b << std::endl;
  std::cout << "TLE x " << c << std::endl;
  std::cout << "RE x " << d << std::endl;
  return 0;
}
