#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  int status[4] = {0, 0, 0, 0};
  for (int i = 0; i < N; i++) {
    char c;
    std::cin >> c;
    if (c == 'A')
      status[0]++;
    else if (c == 'W')
      status[1]++;
    else if (c == 'T')
      status[2]++;
    else if (c == 'R')
      status[3]++;
  }
  std::cout << "AC x " << status[0] << std::endl;
  std::cout << "WA x " << status[1] << std::endl;
  std::cout << "TLE x " << status[2] << std::endl;
  std::cout << "RE x " << status[3] << std::endl;
}
