#include <bits/stdc++.h>
#pragma GCC target("sse4.2")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int dr[] = {0, 1, -1, 0, 1, -1, 1, -1};
int dc[] = {1, 0, 0, -1, 1, -1, -1, 1};
bool chk(int a, int b, int n, int m) {
  return 0 <= a && a < n && 0 <= b && b < m;
}
long long exp(long long n, long long m, long long md) {
  long long a = 1;
  while (m > 0) {
    if (m & 1) a = (a * n % md) % md;
    m /= 2;
    n = (n * n) % md;
  }
  return a % md;
}
void disp(vector<int> v) {
  for (auto u : v) cout << u << " ";
  cout << "\n";
}
int getSqr(int x) {
  if (x < 0) return -1;
  int l = sqrt(x);
  for (int i = -2; i <= 2; ++i)
    if (l + i >= 0 && (l + i) * (l + i) == x) return l;
  return -1;
}
const int NPRR = 1e7;
vector<int> lp;
vector<int> pr;
void prfac(int n = NPRR) {
  assert(n <= NPRR);
  lp.assign(n + 1, 0);
  int i;
  for (i = 2; i <= n; ++i) {
    if (lp[i] == 0) {
      lp[i] = i;
      pr.push_back(i);
    }
    for (int u : pr) {
      if (i * u > n || u > lp[i]) break;
      lp[i * u] = u;
    }
  }
}
void go2() {
  long long n, x;
  cin >> n >> x;
  long long i, j, k;
  long long a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  bool ok[n];
  memset(ok, true, sizeof(ok));
  long long ans = 0;
  while (true) {
    auto d = lower_bound(a, a + n, x);
    if (d == a + n) {
      break;
    }
    if (ok[d - a] && a[d - a] == x) {
      ok[d - a] = false;
      ans++;
      x *= 2;
      continue;
    }
    if (0 <= d - a - 1 < n && a[d - a - 1] >= a[d - a] / 2 && ok[d - a - 1]) {
      ok[d - a - 1] = false;
      x = 2 * a[d - a - 1];
      ans++;
      continue;
    }
    ans++;
    x *= 2;
  }
  for (i = 0; i < n; i++)
    if (ok[i]) ans++;
  cout << ans << "\n";
}
void go1() {
  int n, k, i, j;
  cin >> n >> k;
  int a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  int ans = 0, mn = 1e9;
  int anss = 0;
  for (i = 0; i < k; i++) ans += a[i];
  mn = ans;
  for (i = k; i < n; i++) {
    ans += a[i];
    ans -= a[i - k];
    if (mn >= ans) {
      mn = ans;
      anss = i - k;
    }
  }
  anss++;
  cout << anss << "\n";
}
void go3() {
  int n;
  cin >> n;
  int i, j, k;
  string a[n];
  map<string, int> m;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    ++m[a[i]];
  }
  cout << "AC"
       << " "
       << "X"
       << " " << m["AC"] << "\n";
  cout << "WA"
       << " "
       << "X"
       << " " << m["WA"] << "\n";
  cout << "TLE"
       << " "
       << "X"
       << " " << m["TLE"] << "\n";
  cout << "RE"
       << " "
       << "X"
       << " " << m["RE"] << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long tt = 1;
  while (tt--) {
    go3();
  }
  return 0;
}
