#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<char> S(N * 3, 0);
  for (int i = 0; i < N * 3; i++) {
    cin >> S.at(i);
  }
  vector<int> cnt(4);
  cnt.at(0) = 0;
  cnt.at(1) = 0;
  cnt.at(2) = 0;
  cnt.at(3) = 0;
  int i = 0;
  while (S.at(i) != '\0') {
    if (S.at(i) == 'A' && S.at(i + 1) == 'C') {
      cnt.at(0)++;
      i += 2;
    } else if (S.at(i) == 'W' && S.at(i + 1) == 'A') {
      cnt.at(1)++;
      i += 2;
    } else if (S.at(i) == 'T' && S.at(i + 1) == 'L' && S.at(i + 2) == 'E') {
      cnt.at(2)++;
      i += 3;
    } else {
      cnt.at(3)++;
      i += 2;
    }
  }
  cout << "AC x " << cnt.at(0) << endl;
  cout << "WA x " << cnt.at(1) << endl;
  cout << "TLE x " << cnt.at(2) << endl;
  cout << "RE x " << cnt.at(3) << endl;
}
