#include <bits/stdc++.h>
using namespace std;
unordered_map<string, long long> m;
vector<string> arr{"AC", "WA", "TLE", "RE"};
void print() {
  for (auto i : arr) {
    cout << i << "X" << m[i] << "\n";
  }
  return;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    m[s]++;
  }
  print();
  return 0;
}
