#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  unordered_map<string, int> cache(
      {{"AC", 0}, {"WA", 0}, {"TLE", 0}, {"RE", 0}});
  int N;
  cin >> N;
  string input;
  while (N--) {
    cin >> input;
    if (cache.find(input) != cache.end()) cache[input] += 1;
  }
  array<string, 4> v = {"AC", "WA", "TLE", "RE"};
  for (auto& i : v) {
    int r;
    r = cache.at(i);
    cout << i << " X " << r << "\n";
  }
  return 0;
}
