#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using ld = long double;
using pll = pair<ll, ll>;
using vll = vector<ll>;
using pll = pair<ll, ll>;
void buff() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
}
constexpr ll MOD = 1e9 + 7;
inline ll pow_mod(ll a, ll b, ll mod = MOD) {
  ll res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
  }
  return res;
}
int main() {
  buff();
  map<string, int> memo;
  int n;
  cin >> n;
  for (int i = 0; i < (n); ++i) {
    string s;
    cin >> s;
    memo[s]++;
  }
  cout << "AC X " << memo["AC"] << '\n';
  cout << "WA X " << memo["WA"] << '\n';
  cout << "TLE X " << memo["TLE"] << '\n';
  cout << "RE X " << memo["RE"] << '\n';
  return 0;
}
