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