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