#include <bits/stdc++.h>
using namespace std;
long long int fact[500005], invfact[500005];
long long int power(long long int x, long long int y) {
  long long int z = 1;
  while (y > 0) {
    if (y % 2 == 1) z = (z * x) % 1000000007;
    x = (x * x) % 1000000007;
    y /= 2;
  }
  return z;
}
long long int inv(long long int x) { return power(x, 1000000007 - 2); }
long long int divide(long long int x, long long int y) {
  return (x * inv(y)) % 1000000007;
}
long long int C(long long int n, long long int k) {
  if (k > n) return 0;
  return divide(fact[n], (fact[n - k] * fact[k]) % 1000000007);
}
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
void init() {
  long long int p = 1000000007;
  fact[0] = 1;
  long long int i;
  for (i = 1; i < 500005; i++) {
    fact[i] = (i * fact[i - 1]) % p;
  }
  i--;
  invfact[i] = power(fact[i], p - 2);
  for (i--; i >= 0; i--) {
    invfact[i] = (invfact[i + 1] * (i + 1)) % p;
  }
}
long long int s;
long long int fun(long long int a) {
  if (a == 0) return 0;
  return a + fun(a - 1);
}
priority_queue<pair<long long int, long long int>,
               vector<pair<long long int, long long int> >,
               greater<pair<long long int, long long int> > >
    gq;
long long int spf[10000001];
void sieve() {
  spf[1] = 1;
  for (long long int i = 2; i < 10000001; i++) spf[i] = i;
  for (long long int i = 4; i < 10000001; i += 2) spf[i] = 2;
  for (long long int i = 3; i * i < 10000001; i++) {
    if (spf[i] == i) {
      for (long long int j = i * i; j < 10000001; j += i)
        if (spf[j] == j) spf[j] = i;
    }
  }
}
set<long long int> getFactorization(long long int x) {
  set<long long int> ret;
  while (x != 1) {
    ret.insert(spf[x]);
    x = x / spf[x];
  }
  return ret;
}
void ghost() {
  long long int i = 0, j = 0, k = 0, l = 0, n, r = -10000000000, q = 0, x,
                y = 100000000000, m;
  cin >> n;
  map<string, long long int> mp;
  string s;
  for (i = 0; i < n; i++) {
    cin >> s;
    mp[s]++;
  }
  cout << "AC"
          " "
          "X"
          " "
       << mp["AC"] << endl;
  cout << "WA"
          " "
          "X"
          " "
       << mp["WA"] << endl;
  cout << "TLE"
          " "
          "X"
          " "
       << mp["TLE"] << endl;
  cout << "RE"
          " "
          "X"
          " "
       << mp["RE"] << endl;
}
signed main() {
  int test = 1;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  while (test--) ghost();
  return 0;
}
