#include <bits/stdc++.h>
using namespace std;
int main(){
	string x;
	int ac,wa,re,tel,n;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>x;
		if(x="AC") ac++;
		else if(x="RE") re++;
		else if(x="WA") wa++;
		else if(TLE) tel++;
	}
	cout<<"AC x "<<ac<<endl;
	cout<<"WA x "<<wa<<endl;
	cout<<"TLE x "<<tel<<endl;
	cout<<"RE x "<<re<<endl;
	return 0;
}