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