#include <iostream>
using namespace std;
int main()
{
	int c0=0, c1=0,c2=0,c3=0;
	int n;
	string s;
	
	cin >> n;
	for (int i=0; i<n; i++){
		cin >> s;
		if (s=="AC") c0++;
		else if (s=="WA") c1++;
		else if (s=="TLE") c2++;
		else (s=="RE") c3++;
	}
	
	cout << "AC x" << c0
	     << "WA x" << c1
	     << "TLE x" << c2
	     << "RE x" << c3;
	return 0;
}