#include <bits/stdc++.h>

using namespace std;

 

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	// freopen(".inp", "r", stdin);
 // 	freopen(".out", "w", stdout);
 	int n, ac = 0, wa = 0, tle = 0, re = 0;
 	cin >> n;
 	for (int i = 0; i < n; i++) {
 		string s;
 		cin >> s;
 		if (s == "AC") ac++;
 		if (s == "WA") wa++;
 		if (s == 'TLE') tle++;
 		else re++;
 	}
 	cout << "AC x " << ac << endl;
 	cout << "WA x " << wa << endl;
 	cout << "TLE x " << tle << endl;
 	cout << "RE x " << re << endl;
	
}