#include <bits/stdc++.h>
using namespace std;
struct fhash {
  static uint64_t si(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t fr =
        chrono::steady_clock::now().time_since_epoch().count();
    return si(x + fr);
  }
};
string to_string(char c) { return string(1, c); }
string to_string(const char* s) { return (string)s; }
string to_string(string s) { return s; }
template <class A>
string to_string(complex<A> c) {
  stringstream ss;
  ss << c;
  return ss.str();
}
string to_string(vector<bool> v) {
  string res = "{";
  for (int i = 0; i < (int)(((int)(v).size())); ++i) res += char('0' + v[i]);
  res += "}";
  return res;
}
template <size_t SZ>
string to_string(bitset<SZ> b) {
  string res = "";
  for (int i = 0; i < (int)(SZ); ++i) res += char('0' + b[i]);
  return res;
}
template <class A, class B>
string to_string(pair<A, B> p);
template <class T>
string to_string(T v) {
  bool fst = 1;
  string res = "{";
  for (const auto& x : v) {
    if (!fst) res += ", ";
    fst = 0;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <class A, class B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <class T>
bool chmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool chmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
template <class T>
bool ptwo(T a) {
  return a && (!(a & (a - 1)));
}
template <class T>
void remdup(vector<T>& v) {
  sort((v).begin(), (v).end());
  v.erase(unique((v).begin(), (v).end()), end(v));
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
template <class T>
bool prime(T n) {
  for (T i = 2; i * i <= n; i++)
    if (n % i == 0) return 0;
  return 1;
}
vector<int> split(string s) {
  vector<int> v;
  stringstream ss(s);
  for (int i; ss >> i;) {
    v.push_back(i);
    if (ss.peek() == ',') ss.ignore();
  }
  return v;
}
long long mask(int i) { return (long long(1) << i) - 1; }
int pct(signed x) { return __builtin_popcount(x); }
int pct(long long t) { return __builtin_popcountll(t); }
int bits(signed x) { return 31 - __builtin_clz(x); }
int bits(long long t) { return 63 - __builtin_clzll(t); }
template <class T>
void re(T& x) {
  cin >> x;
}
void re(double& d) {
  string t;
  re(t);
  d = stod(t);
}
void re(long double& d) {
  string t;
  re(t);
  d = stold(t);
}
template <class H, class... T>
void re(H& h, T&... t) {
  re(h);
  re(t...);
}
template <class A, class B>
void re(pair<A, B>& p) {
  re(p.first, p.second);
}
template <class A>
void re(vector<A>& x) {
  for (auto& a : x) re(a);
}
template <class A, size_t SZ>
void re(array<A, SZ>& x) {
  for (auto& a : x) re(a);
}
template <class A>
void pr(A x) {
  cout << to_string(x);
}
template <class H, class... T>
void pr(const H& h, const T&... t) {
  pr(h);
  pr(t...);
}
void ps() { pr("\n"); }
template <class H, class... T>
void ps(const H& h, const T&... t) {
  pr(h);
  if (sizeof...(t)) pr(" ");
  ps(t...);
}
void dbg() { cerr << "]" << endl; }
template <class H, class... T>
void dbg(H h, T... t) {
  cerr << to_string(h);
  if (sizeof...(t)) cerr << ", ";
  dbg(t...);
}
const int MOD = 1e9 + 7;
const long long INF = 1e18;
const long double PI = acos((long double)-1);
const int dx[2][4] = {{-1, 1, 0, 0}, {1, -1, -1, 1}};
const int dy[2][4] = {{0, 0, -1, 1}, {1, 1, -1, -1}};
void IOS(int n) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(n);
  cout << fixed;
}
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());
const int MXN = 2e5 + 5;
void solve() {
  int n;
  re(n);
  vector<string> a(n);
  re(a);
  unordered_map<string, int> x;
  for (auto& i : a) x[i]++;
  vector<string> d{"AC", "WA", "TLE", "RE"};
  while (1) {
    if (((int)(x).size()) == 0 || ((int)(d).size()) == 0) break;
    for (auto i = (x).begin(); i != (x).end(); i++) {
      if (i->first == d[0]) {
        ps(d[0], "x", i->second);
        d.erase(d.begin());
        x.erase(i->first);
      }
    }
  }
  for (auto& i : d) ps(i, "x", 0);
}
int main() {
  IOS(10);
  int t = 1;
  for (int i = 1; i <= (int)(t); ++i) solve();
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
  return 0;
}
