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