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