#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  string s;
  map<string, int> mp;
  for (int i = 0; i < (n); ++i) {
    cin >> s;
    mp[s]++;
  }
  auto iter = mp.find("AC");
  if (iter != end(mp)) {
    std::cout << "AC x " << iter->second << std::endl;
  } else {
    std::cout << "AC x " << 0 << std::endl;
  }
  iter = mp.find("WA");
  if (iter != end(mp)) {
    std::cout << "WA x " << iter->second << std::endl;
  } else {
    std::cout << "WA x " << 0 << std::endl;
  }
  iter = mp.find("TLE");
  if (iter != end(mp)) {
    std::cout << "TLE x " << iter->second << std::endl;
  } else {
    std::cout << "TLE x " << 0 << std::endl;
  }
  iter = mp.find("RE");
  if (iter != end(mp)) {
    std::cout << "RE" << iter->second << std::endl;
  } else {
    std::cout << "RE x " << 0 << std::endl;
  }
  return 0;
}
