#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  vector<string> holdStrings;
  vector<string> x{"AC", "WA", "TLE", "RE"};
  while (t--) {
    string str;
    cin >> str;
    holdStrings.push_back(str);
  }
  map<string, int> mp{{"AC", 0}, {"RE", 0}, {"TLE", 0}, {"WA", 0}};
  for (auto str : holdStrings) mp[str]++;
  for (auto str : x) cout << str << " X " << mp[str] << endl;
}
