int main() {

	int N;
	vector<int> S(n);
	for (int i = 0; i < N; i++) {
		cin >> S.at(i);
	}
	int a = 0;
	int b = 0;
	int c = 0;
	int d = 0;
	for (int i = 0; i < N; i++) {
		if (S.at(i) == 'AC') {
			a++;
		}
		else if (S.at(i) == 'WA') {
			b++;
		}
		else if (S.at(i) == 'TLE') {
			c++;
		}
		else {
			d++
		}
	}
	cout << "AC x " << a << endl;
	cout << "WA x " << b << endl;
	cout << "TLE x " << c << endl;
	cout << "Re x " << d << endl;
}