#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<string> S(N);
  for (int i = 0; i < (N); i++) {
    cin >> S.at(i);
  }
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  for (int i = 0; i < (N); i++) {
    if (S.at(i).at(0) == 'A') {
      ac += 1;
    } else if (S.at(i).at(0) == 'W') {
      wa += 1;
    } else if (S.at(i).at(0) == 'T') {
      tle += 1;
    } else if (S.at(i).at(0) == 'R') {
      re += 1;
    }
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}
