#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
signed main() {
  long long n;
  cin >> n;
  vector<string> ans(n);
  for (long long i = 0; i < n; i++) cin >> ans[i];
  long long ac, wa, tle, re;
  for (long long i = 0; i < n; i++) {
    if (ans[i] == "AC") ac++;
    if (ans[i] == "WA") wa++;
    if (ans[i] == "TLE") tle++;
    if (ans[i] == "RE") re++;
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}
