#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
int main() {
  ll n;
  cin >> n;
  vector<string> s = {"AC", "WA", "TLE", "MLE"};
  vector<ll> ans(4);
  for (ll i = 0; i < (ll)n; ++i) {
    string t;
    cin >> t;
    for (ll j = 0; j < (ll)4; ++j)
      if (t == s.at(j)) {
        ans.at(j)++;
        break;
      }
  }
  for (ll i = 0; i < (ll)4; ++i) {
    cout << s.at(i) << " x " << ans.at(i) << endl;
  }
  return 0;
}
