#include <bits/stdc++.h>
using namespace std;
#define ll long long int


void solution(){
	ll n;
	cin>>n;
	string s;
	counter ac=0,wa=0,tle=0,re=0;
	for(ll i=0; i<n;++i){
		cin>>s;
		if(s=="AC")
			ac++;
		else if(s=="WA")
			wa++;
		else if(s=="TLE")
			tle++;
		else
			re++;
	}
	cout<<"AC X "<<ac<<"\nWA X "<<wa<<"\nTLE X "<<tle<<"\nRE X "<<re<<'\n';
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cerr.tie(0);
	solution();
	return 0;
}