#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  while (t--) {
    string str[t];
    for (int i = 0; i < t; i++) {
      cin >> str[i];
      if (str[i][0] == 'A' && str[i][1] == 'C') {
        ac++;
      } else if (str[i][0] == 'W' && str[i][1] == 'A') {
        wa++;
      } else if (str[i][0] == 'R' && str[i][1] == 'E') {
        re++;
      } else if (str[i][0] == 'T' && str[i][1] == 'L' && str[i][2] == 'E') {
        tle++;
      }
    }
  }
  cout << "AC x " << ac << "\n";
  cout << "WA x " << wa << "\n";
  cout << "TLE x " << tle << "\n";
  cout << "RE x " << re << "\n";
  return 0;
}
