#include <iostream>
#include <string>

int main() {
  	long n, ac = 0, wa = 0, tle = 0, re = 0;
  	std::cin >> n;
  	string x;
  	for ( long l = 0; l < N; l++ ) {
      	std::cin >> x;
      	if ( x == "AC" )
          	ac++;
      	else if ( x == "WA" ) 
          	wa++;
      	else if ( x == "TLE" )
          	tle++;
      	else if ( x == "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 0;
}