#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long mod = 1e9 + 7;
void very_fast() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long binary_exponentation(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret = (ret * a) % mod;
    b >>= 1;
    a = (a * a) % mod;
  }
  return ret;
}
int32_t main() {
  very_fast();
  {
    long long n, cnt1 = 0, cnt2 = 0, cnt3 = 0, cnt4 = 0;
    cin >> n;
    for (long long i = 1; i <= n; i++) {
      string s;
      cin >> s;
      if (s == "AC") {
        cnt1++;
      } else if (s == "WA") {
        cnt2++;
      } else if (s == "TLE") {
        cnt3++;
      } else
        cnt4++;
    }
    cout << "AC"
         << " "
         << "X"
         << " " << cnt1 << endl;
    cout << "WA"
         << " "
         << "X"
         << " " << cnt2 << endl;
    cout << "TLE"
         << " "
         << "X"
         << " " << cnt3 << endl;
    cout << "RE"
         << " "
         << "X"
         << " " << cnt4 << endl;
  }
  return 0;
}
