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