#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;cin>>n;
	int i;string s;
	int cac=0,ctle=0,cwa=0,cre=0;
	for(i=0;i<n;i++)
	{
		cin>>s;
		if(s=="AC")
		cac++;
		else if(s=="WA")
		cwa++;
		else if(s=="TLE")
		ctel++;
		else
		cre++;
	}
	cout<<"AC x "<<cac<<endl;
	cout<<"WA x "<<cwa<<endl;
	cout<<"TLE x "<<ctel<<endl;
	cout<<"RE x "<<cre<<endl;
  return 0;
}