#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n;
  unordered_map<string, int> m;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    m[s]++;
  }
  string z[4] = {"AC", "WA", "TLE", "RE"};
  for (int i = 0; i < 4; ++i) {
    cout << z[i] << " X " << m[z[i]] << endl;
  }
  return 0;
}
