#include <bits/stdc++.h>
using namespace std;
#define int long long
#define N 100005
#define m 1000000007
#define dd double
#define pb push_back
#define mp make_pair
#define clr(x) x.clear()
#define sz(x) ((int)(x).size())
#define F first
#define S second
int32_t main() 
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n,i;
	cin>>n;
	string s;
	map<string,int>mp;
	mp["AC"]=0;
	mp["WA"]=0;
	mp["TLE"]=0;
	mp["RE"]=0;
	for(i=0;i<n;++i)
	{
		cin>>s;
		mp[s]++;
	}
	cout<<"AC x "mp["AC"]<<endl
		<<"WA x "mp["WA"]<<endl
		<<"TLE x "mp["TLE"]<<endl
		<<"RE x "mp["RE"];
}
