#include <bits/stdc++.h>
using namespace std;
string s[] = {"AC", "WA", "TLE", "RE"};
void countFreq(string arr[], int n) {
  unordered_map<string, int> mp;
  for (int i = 0; i < n; i++) mp[arr[i]]++;
  for (int i = 0; i < 4; i++) {
    int flag = 0;
    for (auto x : mp) {
      if (x.first == s[i]) {
        cout << s[i] << " X " << x.second << endl;
        flag = 1;
        break;
      }
    }
    if (flag != 1) cout << s[i] << " X " << 0 << endl;
  }
}
int main() {
  int N;
  cin >> N;
  cin.get();
  string arr[N];
  for (int i = 0; i < N; i++) getline(cin, arr[i]);
  countFreq(arr, N);
  return 0;
}
