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