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