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