#include <bits/stdc++.h>
using namespace std;
struct hash_pair {
  template <class T1, class T2>
  size_t operator()(const pair<T1, T2>& p) const {
    auto hash1 = hash<T1>{}(p.first);
    auto hash2 = hash<T2>{}(p.second);
    return hash1 ^ hash2;
  }
};
int MAXNUM = 5e3 + 5;
vector<int> vis(MAXNUM);
vector<int> pr;
void sieve() {
  pr.push_back(2);
  for (long long i = 3; i < MAXNUM; i += 2)
    if (!vis[i]) {
      pr.push_back(i);
      for (long long j = i * i; j < MAXNUM; j += 2 * i) vis[j] = true;
    }
}
long long mod = 1000000007;
void solve() {
  long long n;
  cin >> n;
  map<string, int> m;
  m["AC"] = m["WA"] = m["TLE"] = m["RE"] = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    m[s]++;
  }
  cout << "AC X " << m["AC"] << endl;
  cout << "WA X " << m["WA"] << endl;
  cout << "TLE X " << m["TLE"] << endl;
  cout << "RE X " << m["RE"] << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
