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