	char Judge[4];
	int count[4] = { 0,0,0,0 };

	int N = 0;

	cin >> N;

	for (int i = 0; i < N; i++) {
		cin >> Judge;

		if (!strcmp(Judge, "AC"))
			(count[0])++;
		else if (!strcmp(Judge, "WA"))
			(count[1])++;
		else if (!strcmp(Judge, "TLE"))
			(count[2])++;
		else
			(count[3])++;
	}

	cout << "AC" << " x " << count[0] << "\n";
	cout << "WA" << " x " << count[1] << "\n";
	cout << "TLE" << " x " << count[2] << "\n";
	cout << "RE" << " x " << count[3] << "\n";

	system("pause");