#include <bits/stdc++.h>
using namespace std;
const long long int infinity = 9e18;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  map<string, long long int> m;
  string str[] = {"AC", "WA", "TLE", "RE"};
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    m[s]++;
  }
  for (int i = 0; i < 4; i++) {
    cout << str[i] << " X " << m[str[i]] << "\n";
  }
  return 0;
}
