#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  std::map<std::string, int> mp;
  for (int i = 0; i < n; ++i) {
    std::string s;
    std::cin >> s;
    mp[s] += 1;
  }
  std::cout << "AC x " + mp["AC"] << '\n';
  std::cout << "WA x " + mp["WA"] << '\n';
  std::cout << "TLE x " + mp["TLE"] << '\n';
  std::cout << "RE x " + mp["RE"] << '\n';
  return 0;
}
