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