#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 verdict;
    cin >> verdict;
    if (verdict == "AC") {
      ac++;
    } else if (verdict == "WA") {
      wa++;
    } else if (verdict == "TLE") {
      tle++;
    } else if (verdict == "RE") {
      re++;
    }
  }
  cout << "AC X " << ac << endl;
  cout << "WA X " << wa << endl;
  cout << "TLE X " << tle << endl;
  cout << "RE X " << re << endl;
}
