	#include <bits/stdc++.h>
	#define ll long long
	#define f(i,a,b) for(ll i=a;i<b;i++)
	#define fi(i,a,b) for(ll i=b;i>=a;i--)
	using namespace std;
	ll mod(ll a)
	{
	if(a>0)
	return a;
	else
	return -a;
	}
	ll min(ll a,ll b)
	{
	if(a>b)
	return b;
	else
	return a;
	}
	ll gcd(ll a, ll b)
	{
	    if (b == 0)
	        return a;
	    return gcd(b, a % b);

	}
	ll max(ll a,ll b)
	{
	if(a<b)
	return b;
	else
	return a;
	}
	int main()
	{

	ll max=0,i1,n,n1,n2,i,w,j,l=0,k=0,c0=0,c1=0,c2=0,c3=0,m,t,gcd1;
	cin>>t;
	string s1,s2;
	for(i1=0;i1<t;i1++)
	{
	cin>>s1;
	if(s1=="TLE")
	c2++;
	if(s1=="AC")
	c0++;
	if(s2=="WA")
	c1++;
	if(s3=="RE")
	c3++;
	}
	cout<<"AC X "<<c0<<endl<<"WA X "<<c1<<endl<<"TLE X "<<c2<<endl<<"RE X "<<c3;
	return 0;
	}
