#include <bits/stdc++.h>
using namespace std;
long long n, i, t, c = -1, a, b, sum, x, y;
int main() {
  cin >> n;
  string s;
  vector<pair<string, long long> > m(4);
  m[0].first = "AC";
  m[1].first = "WA";
  m[2].first = "TLE";
  m[3].first = "RE";
  while (n--) {
    cin >> s;
    for (i = 0; i < 4; i++) {
      if (m[i].first == s) {
        m[i].second++;
      }
    }
  }
  for (i = 0; i < 4; i++) {
    cout << m[i].first << " X " << m[i].second << endl;
  }
}
