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