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