#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  map<string, int> mp;
  for (long long int i = 0; i < n; i++) {
    string x;
    cin >> x;
    mp[x]++;
    cout << "AC"
         << " X " << mp["AC"] << endl;
    cout << "WA"
         << " X " << mp["WA"] << endl;
    cout << "TLE"
         << " X " << mp["TLE"] << endl;
    cout << "RE"
         << " X " << mp["RE"] << endl;
  }
}
