#include<iostream>
using namespace std;
int main()
{
	int N;

	cin >> N;

	string str[10000];
	
	for (int i = 0; i < N; i++) {
		cin >> str[i];
	}

	int C[3];

	for (int j = 0; j < 4; j++) {
		C[j] = 0;
	}

	for (int k = 0; k < N; k++) {
		if (str[k] == "AC") {
			C[0]++;
		}
		else if (str[k] == "WA") {
			C[1]++;
		}
		else if (str[k] == "TLE") {
			C[2]++;
		}
		else if (str[k] == "RE") {
			C[3]++;
		}
	}

	cout << "AC x " << C[0] << endl;
	cout << "WA x " << C[1] << endl;
	cout << "TLE x " << C[2] << endl;
	cout << "RE x " << C[3] << endl;

	delete[] C;
}