#include <iostream>
#include <string>

int main() {
  int ac=0;
  int wa=0;
  int tle=0;
  int re=0;
  std::string input;
  while(std::cin >> input;) {
    if(input == "AC") {
      ++ac;
    } else if(input == "WA") {
      ++wa;
    } else if(input == "TLE") {
      ++tle;
    } else if(input == "RE") {
      ++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;
  return;
}