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

int main()
{
	string str;
	ll i;
	cin >> i;
	int count=0, cnt=0, num=0, n=0;
	vector<string>vec;
	for (int j = 0; j < i; j++)
	{
		cin >> str;
		vec.push_back(str);
		
		
		
	}for (int i = 0; i < str.size(); i++) {
			if (str[0] == 'A' && str[1] == 'C') count++;
			if (str[0] == 'W' && str[1] == 'A') cnt++;
			if (str[0] == 'T' && str[1] == 'L' && str[2] == 'E') num++;
			if (str[0] == 'R' && str[1] == 'E') n++;
		}
		cout << "AC" <<" x " << count/2 << endl;
		cout << "WA" << " x " << cnt/2 << endl;
		cout << "TLE" << " x " << num / 3<< endl;
		cout << "RE" << " x " << n << endl;
	
	return 0;
}
