#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
const long long int INF = 1e18;
const long long int N = 1e6 + 20;
vector<long long int> g[N];
vector<long long int> vis(N);
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int tc = 1;
  while (tc--) {
    vector<string> v = {"AC", "WA", "TLE", "RE"};
    long long int n;
    cin >> n;
    map<string, long long int> cnt;
    while (n--) {
      string s;
      cin >> s;
      cnt[s]++;
    }
    for (auto &it : v) {
      cout << it << ' ' << "X " << cnt[it] << '\n';
    }
  }
}
