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