#include <bits/stdc++.h>
int main() {
  int ac = 0, wa = 0, tle = 0, re = 0;
  char a = 'a', w = 'w', t = 't', r = 'r', tmp;
  int N;
  std::cin >> N;
  for (int i = 0; i < N; ++i) {
    std::cin >> tmp;
    if (tmp == a)
      ac++;
    else if (tmp == w)
      wa++;
    else if (tmp == t)
      tle++;
    else
      re++;
  }
  std::cout << "AC x " << ac << std::endl;
  std::cout << "WA x " << wa << std::endl;
  std::cout << "TLE x " << tle << std::endl;
  std::cout << "RE x " << re << std::endl;
}
