#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int ac = 0, wa = 0, tle = 0, re = 0;
  vector<string> S(N);
  for (auto& x : S) {
    cin >> x;
    if (x == "AC") {
      cout << x << endl;
      ac++;
    } else if (x == "WA") {
      wa++;
    } else if (x == "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;
}
