#include<bits/stdc++.h>                   // below comment for pbds
#include<ext/pb_ds/assoc_container.hpp>   // to use it make ordered_set
#include<ext/pb_ds/tree_policy.hpp>       // all set fnct + = 1. order_of_key(x); // number of 
#define ll long long                      //element strictly smaller than it;
#define ld long double                    // 2. find_by_order(x),pointer el at x pos after sort  use as s.f();
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
using namespace std;                     
using namespace __gnu_pbds;
// assert(a[i]<n ) // if we want to check for special cond , used for debug
// make less_equal in order to make a multiset pbds
const ll Mod = 998244353;
ll CaseN=1;



ll tst(ll n ,ll *a)
{
 ll ans=0; 
	

 return ans;
}


void solve()
{	
	ll n;
	cin>>n;
	vector<ll> v(5,0);
	
	for(ll i=0;i<n;i++)
	{
	string s;
	cin>>s;
	if(s=="AC")
	{
	v[0]++;	
	}
	else if(s=="WA")
	{
	v[1]++;	
	}
	else if(s=="TLE")
	{
	v[2]++;	
	}
	else if(s=="RE")
	{
	v[3]++;
	}
	}
	
	cout<<"AC x "<<v[0]<<endl;
	cout<<"WA x "<<v[1]<<endl;
	cout<<"TLE x "<<v[2]<<endl;
	cout<<"RE x "<<v[3]<<endl;
	//cerr<<"Case #"<<CaseN<<": ";
    CaseN++;   

return ;
}


signed main() {
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t=1;
	//cin>>t;
	while(t--)
	{	
	
	solve();	
	}
}
