#include <bits/stdc++.h>
using namespace std;
string s[] = {"AC", "WA", "TLE", "RE"};
int main() {
  int N;
  cin >> N;
  cin.get();
  string arr[N];
  for (int i = 0; i < N; i++) getline(cin, arr[i]);
  for (int i = 0; i < 4; i++) {
    int count = 0;
    for (int j = 0; j < N; j++) {
      if (s[i] == arr[j]) count++;
    }
    cout << s[i] << " X " << count << endl;
  }
}
