#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  map<string, int> mp;
  string s;
  vector<string> v = {"AC", "WA", "TLE", "RE"};
  for (auto c : v) {
    mp[c] = 0;
  }
  while (n--) {
    cin >> s;
    mp[s]++;
  }
  for (auto c : v) {
    cout << c << " X " << mp[c] << '\n';
  }
  return 0;
}
