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