#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;cin>>n;
	int ac=0;
	int w=0;int t=0;int r=0;
	while(n--)
	{
		string s;cin>>s;
		if(s=="AC")
		{
			ac++;
		}
		if(s=="WA")
		{
			w++;
		}
		if(s=="TLE")
		{
			t++;
		}
		if(s=="RE")
		{
			r++;
		}
	}
	cout<<"AC x "<<ac<<"\n";
	cout<<"WA x "<<w<<"\n";
	cout<<"TLE x "<<t<<"\n";
	cout<<"RE x "<<r<"\n";
	return 0;
}