#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
ll mod = 1000000007;
const int INF = 1e9;
const ll LINF = 1e18;
ll mod_sum() { return 0LL; }
template <typename T, typename... Args>
T mod_sum(T a, Args... args) {
  return ((a + mod_sum(args...)) % mod + mod) % mod;
}
ll mod_prod() { return 1LL; }
template <typename T, typename... Args>
T mod_prod(T a, Args... args) {
  return (a * mod_prod(args...)) % mod;
}
using pii = pair<ll, ll>;
using vi = vector<ll>;
using vb = vector<bool>;
using vvi = vector<vector<ll> >;
using vvb = vector<vector<bool> >;
using vpii = vector<pii>;
using vvpii = vector<vector<pii> >;
ll solve() {
  ll n;
  cin >> n;
  map<string, ll> mp;
  mp["AC"] = 0;
  mp["WA"] = 0;
  mp["RE"] = 0;
  mp["TLE"] = 0;
  for (ll i = 0; i < n; i++) {
    string str;
    cin >> str;
    mp[str]++;
  }
  cout << "AC X " << mp["AC"] << '\n';
  cout << "WA X " << mp["WA"] << '\n';
  cout << "TLE X " << mp["TLE"] << '\n';
  cout << "RE X " << mp["RE"] << '\n';
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ll t = 1;
  while (t--) solve();
  return 0;
}
