#include <bits/stdc++.h>
using namespace std;
 
//DEFINE and TYPEDEF--------------------------------------------------------------
// For actual content check from line 94

#define FORG(i,a,n) for(lld i=(lld)a;a<n?i<(lld)n:(lld)n<i;a<n?++i:--i) //for - general
#define FORZ(i,n) for(lld i=0;i<(lld)n;++i) //for - zero
#define FORGI(i,a,n,inc) for(lld i=(lld)a;a<n?i<(lld)n:(lld)n<i;a<n?i+=inc:i-=inc) //for - general incremental
#define FORZI(i,n,inc) for(lld i=0;i<(lld)n;i+=inc) //for - zero incremental
#define SPEEDUP ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define MEM(a,val) memset(a,val,sizeof(a));
 
#define all(m) m.begin(),m.end()
#define sz(m) (lld)m.size()
 
#define st first
#define nd second
#define pb push_back
#define DEC(x) fixed<<setprecision(x)
 
typedef long long int lld;
typedef unsigned long long int ulld;
 
//DEBUGGER------------------------------------------------------------------------
// #define DEBUG(x) cerr<<(#x)<<" is "<<(x)<<"\n" //to debug values of variables
#define DEBUGON
#define ZINDA cerr<<"\nIdhar-ich hai apun!!\n"; //to debug if code reached that point

#ifdef DEBUGON
	vector<string> vec_splitter(string s) 
	{
		for(char& c: s) c = c == ',' ?  ' ': c;
		stringstream ss; ss << s;
		vector<string> res;
		for(string z; ss >> z; res.push_back(z));
		return res;
	}

	void debug_out(
	vector<string> __attribute__ ((unused)) args, __attribute__ ((unused)) int idx, __attribute__ ((unused)) int LINE_NUM) { cerr << endl; } 
	template <typename Head, typename... Tail>
		void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) 
		{
			if(idx > 0) cerr << ", "; 
			else cerr << "Line(" << LINE_NUM << "): ";
			stringstream ss; ss << H;
			cerr << args[idx] << " = " << ss.str();
			debug_out(args, idx + 1, LINE_NUM, T...);
		}

	#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__);
	#define DEBUG(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__);
#else
	#define debug(...) 320;
	#define DEBUG(...) 320;
#endif

lld power(lld b, lld e)
{
	assert(e>=0);
    if(e==0) return 1;
    if(e%2==1) return b*power(b*b,(e-1)/2);
    else return power(b*b,e/2);
}
 
lld power(lld b, lld e, lld m)
{
	assert(e>=0);
	if(e==0) return 1;
	if(e%2==1) return b*power(((b%m)*(b%m))%m,(e-1)/2,m)%m;
	else return power(((b%m)*(b%m))%m,e/2,m)%m;
}
 
int nDig(lld n)
{
	if(n<0) n*=-1;
	if(n==0) return 1;
    else return int(log10(n) + 1);
}

int lognk(lld n, lld k) // logk(n)
{
	assert(n>=0 and k>=0 and k!=1);
	if(n==0) return -1;
	else return lognk(n/k,k)+1;
}

const long double pi = acos(-1);
#define endl '\n'
#define mod 1000000007

//endl : changed to '\n', to flush comment that definition
//--------------------------------------------------------------------------------

void swagWaalaFunction()
{
	lld n;
	cin>>n;

	map<string,lld> m;
	string s;
	FORZ(i,n)
	{
		cin>>s;
		m[s]++;
	}

	cout<<"AC x "<<m["AC"]<<endl;
	cout<<"WA x "<<m["WA"]<<endl;
	cout<<"TLE x "<<m["TLE"]<<endl;
	cout<<"RE x "<<m["RE"]<<endl;
	return;
}

int main()
{
    SPEEDUP;
 	lld t=1;
 	//cin>>t;

 	#ifdef PRIMES
 		sieve();
 	#endif

 	#ifdef CHOOSE
 		nCrModInit();
 	#endif

 	while(t--)
 		swagWaalaFunction();
	
	// cerr<<"\n"<<timeKyaHorhaH; 	
 	return 0;
}

Measured memory_bytes: 3688