#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  string s;
  string tmp[] = {"AC", "WA", "TLE", "RE"};
  int ac = 0, wa = 0, tle = 0, re = 0;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    if (s == tmp[0])
      ++ac;
    else if (s == tmp[1])
      ++wa;
    else if (s == tmp[2])
      ++tle;
    else
      ++re;
  }
  cout << tmp[0] << " X " << ac << "\n";
  cout << tmp[1] << " X " << wa << "\n";
  cout << tmp[2] << " X " << tle << "\n";
  cout << tmp[3] << " X " << re << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
