#include <bits/stdc++.h>
using namespace std;
int main() {
  int A;
  cin >> A;
  vector<string> S(A);
  for (int i = 0; i < A; i++) {
    cin >> S.at(i);
  }
  int countA = 0;
  int countW = 0;
  int countT = 0;
  int countR = 0;
  for (int i = 0; i < A; i++) {
    if (S.at(i).at(0) == 'A') countA++;
    if (S.at(i).at(0) == 'W') countW++;
    if (S.at(i).at(0) == 'T') countT++;
    if (S.at(i).at(0) == 'R') countR++;
  }
  cout << "AC"
       << " "
       << "x" << countA << endl;
  cout << "WA"
       << " "
       << "x" << countW << endl;
  cout << "TLE"
       << " "
       << "x" << countT << endl;
  cout << "RE"
       << " "
       << "x" << countR << endl;
}
