#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int ac = 0, tle = 0, re = 0, wa = 0;
  cin >> N;
  string p;
  for (int i = 0; i < N; i++) {
    cin >> p;
    if (p.compare("AC")) {
      ac += 1;
    } else if (p.compare("TLE")) {
      tle += 1;
    } else if (p.compare("RE")) {
      re += 1;
    } else if (p.compare("WA")) {
      wa += 1;
    }
  }
  cout << "AC x " << ac << endl
       << "WA x " << wa << endl
       << "TLE x " << tle << endl
       << "RE x " << re << endl;
}
