#include <bits/stdc++.h>
using namespace std;
struct dbg {
  template <class T>
  dbg &operator<<(T oth) {
    return *this;
  }
};
using ll = long long;
using ull = unsigned long long;
using ld = long double;
int main(int argc, char **argv) {
  auto solve = [&]() {
    ll n;
    cin >> n;
    map<string, int> ans;
    ans.insert({"AC", 0});
    ans.insert({"RE", 0});
    ans.insert({"TLE", 0});
    ans.insert({"WA", 0});
    while (n--) {
      string s;
      cin >> s;
      ++ans[s];
    }
    for (auto r : ans) {
      printf("%s x %d\n", r.first.c_str(), r.second);
    }
  };
  int t;
  t = 1;
  while (t--) solve();
  return 0;
}
