#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ll t;
  t = 1;
  while (t--) {
    ll n;
    cin >> n;
    map<string, ll> m;
    for (ll i = 0; i < n; i++) {
      string f;
      cin >> f;
      m[f]++;
    }
    for (ll i = 0; i < 4; i++) {
      cout << "AC"
           << "x" << m["AC"];
      cout << "WA"
           << "x" << m["WA"];
      cout << "TLE"
           << "x" << m["TLE"];
      cout << "RE"
           << "x" << m["RE"];
    }
  }
}
