#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
const double PI=acos(-1);
using namespace std;
using boost::multiprecision::cpp_int;
#define ll long long
#define ull unsigned long long
#define ul unsigned long
#define ci cpp_int
#define MOD 1000000007

long findmin(long a,long b) {
	return a<b?a:b;
}
long findmax(long a,long b) {
	return a>b?a:b;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	long n,ac=0,wa=0,tle=0,re=0;
	cin>>n;
	string s;
	while(n--) {
		cin>>s;
		if(s=="AC") {
			ac++;
		}
		else if(s=="TLE") {
			tle++;
		}
		else if(s=="WA") {
			wa++;
		}
		else if(s=="RE") {
			re++;
		}
	}
	cout<<"AC X "<<ac<<"\n";
	cout<<"WA X "<<wa<<"\n";
	cout<<"TLE X "<<tle<<"\n";
	cout<<"RE X "<<re<<"\n";
	cout.flush();
	return 0;
}
