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