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