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

int main()
{

  ll n, a=0, b=0, c=0, d=0;
	string s;
	while(n--){
		cin>>s;
		if(s=="AC")
		a++;
		else if(s=="WA")
		b++;
		else if(s=="TLE")
		c++;
		else
		d++;
	}
	cout<<"AC x "<<a<<"\n";
	cout<<"WA x "<<b<<"\n";
	cout<<"TLE x "<<c<<"\n";
	cout<<"RE x "<<d<<;
	return 0;
}
