#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int t;
  cin >> t;
  unsigned long long int ac, tle, wa, re;
  ac = tle = wa = re = 0;
  string a;
  while (t--) {
    cin >> a;
    if (a == "AC") ac++;
    if (a == "TLE") tle++;
    if (a == "WA") wa++;
    if (a == "RE") re++;
  }
  cout << "AC X " << ac << "\n"
       << "WA X " << wa << "\n"
       << "TLE X " << tle << "\n"
       << "RE X " << re << "\n";
  return 0;
}
