#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  int ac(0), wa(0), tle(0), re(0);
  for (int i = 0; i < (n); ++i) {
    string buf;
    cin >> buf;
    if (buf == "AC") {
      ac++;
    } else if (buf == "WA") {
      wa++;
    } else if (buf == "TLE") {
      tle += 1;
    } else {
      re++;
    }
  }
  cout << "AC"
       << " X " << ac << endl;
  cout << "WA"
       << " X " << wa << endl;
  cout << "TLE"
       << " X " << tle << endl;
  cout << "RE"
       << " X " << re << endl;
  return 0;
}
