#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define F first
#define S second
#define pb push_back
#define endl "\n"
#define all(v) (v).begin(),(v).end()

typedef pair<ll,ll> pi;

void solve()
{
    ll n,i,j,k,x,y,z;
    ll ac=0,wa=0,tle=0,re=0;
    cin>>n;
    for(i=0;i<n;i++)
    {
    	string s;
    	cin>>s;
    	is(s=="AC")
    	{
    		ac++;
		}
		else if(s=="WA")
		{
			wa++;
		}
		else if(s=="TLE")
		{
			tle++;
		}
		else
		{
			re++;
		}
	}
	cout<<"AC x "<<ac<<endl;
	cout<<"WA x "<<wa<<endl;
	cout<<"TLE x "<<tle<<endl;
	cout<<"RE x "<<re<<endl;
	
}

int main() {
	// your code goes here
	int t=1;
	//cin>>t;
	while(t--)
	{
	    solve();
	}
	return 0;
}

