#include <iostream>
#include <string>
using namespace std;

void main() {
	int ac = 0;
	int wa = 0;
	int tle = 0;
	int re = 0;
	int num = 0;
	string value;
	cin >> num;
	for (int i = 0; i < num; i++) {
		cin >> value;
		if (value == "AC") {
			ac++;
		}
		else if (value == "TLE") {
			tle++;
		}
		else if (value == "WA") {
			wa++;
		}
		else if (value == "RE") {
			re++;
		}
	}
	cout << "AC x " << ac << endl;
	cout << "WA x " << wa << endl;
	cout << "TLE x " << tle << endl;
	cout << "RE x " << re << endl;

}