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