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