#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ac, wa, tle, re;
  ac = 0;
  wa = tle = re = 0;
  cin >> n;
  cin.ignore(256, '\n');
  for (int i = 0; i < n; i++) {
    string s;
    getline(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;
}
