#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(void) {
  ll N;
  cin >> N;
  vector<string> j(N);
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  for (int i = 0; i < N; i++) {
    cin >> j.at(i);
    if (j.at(i) == "AC") {
      ac++;
    } else if (j.at(i) == "WA") {
      wa++;
    } else if (j.at(i) == "TLE") {
      tle++;
    } else {
      re++;
    }
  }
  cout << "AC X " << ac << endl;
  cout << "WA X " << wa << endl;
  cout << "TLE X " << tle << endl;
  cout << "RE X " << re << endl;
}
