#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int64_t i, j, k, n;
  cin >> n;
  map<string, int64_t> map;
  vector<string> s(4);
  s[0] = "AC";
  s[1] = "WA";
  s[2] = "TLE";
  s[3] = "RE";
  for (i = 0; i < 4; ++i) map.insert(make_pair(s[i], 0));
  while (n--) {
    string s1;
    cin >> s1;
    map[s1]++;
  }
  for (i = 0; i < s.size(); ++i) {
    cout << s[i] << " X " << map[s[i]] << "\n";
  }
  return 0;
}
