#include <bits/stdc++.h>
using namespace std;
void mahakal() {}
const long long maxN = 1e5 + 5;
long long n;
string second;
vector<pair<string, long long>> ans(4);
void solve() {
  cin >> n;
  map<string, long long> mp;
  for (long long i = 0; i < n; i++) {
    string second;
    cin >> second;
    mp[second]++;
  }
  ans[0].first = "AC", ans[1].first = "WA", ans[2].first = "TLE",
  ans[3].first = "RE";
  for (auto x : mp) {
    if (x.first == "AC") ans[0].first = x.first, ans[0].second = x.second;
    if (x.first == "WA") ans[1].first = x.first, ans[1].second = x.second;
    if (x.first == "TLE") ans[2].first = x.first, ans[2].second = x.second;
    if (x.first == "RE") ans[0].first = x.first, ans[0].second = x.second;
  }
  for (auto x : ans) cout << x.first << " x " << x.second << endl;
}
int main() {
  long long t = 1;
  while (t--) solve();
  return 0;
}
