#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  map<string, int> m;
  while (n--) {
    string s;
    cin >> s;
    m[s]++;
  }
  int flag = 0;
  for (auto it = m.begin(); it != m.end(); it++) {
    if (it->first == "AC") {
      flag = 1;
      cout << "AC x " << it->second << endl;
      break;
    }
  }
  if (flag != 1) {
    cout << "AC x "
         << "0" << endl;
  }
  flag = 0;
  for (auto it = m.begin(); it != m.end(); it++) {
    if (it->first == "WA") {
      flag = 1;
      cout << "WA x " << it->second << endl;
      break;
    }
  }
  if (flag != 1) {
    cout << "WA x "
         << "0" << endl;
  }
  flag = 0;
  for (auto it = m.begin(); it != m.end(); it++) {
    if (it->first == "TLE") {
      flag = 1;
      cout << "TLE x " << it->second << endl;
      break;
    }
  }
  if (flag != 1) {
    cout << "TLE x "
         << "0" << endl;
  }
  flag = 0;
  for (auto it = m.begin(); it != m.end(); it++) {
    if (it->first == "RE") {
      cout << "RE x " << it->second << endl;
      break;
    }
  }
  if (flag != 1) {
    cout << "RE x "
         << "0" << endl;
  }
}
