#include<bits/stdc++.h>
using namespace std;
int main()
{
	int N,i;
	cin>>N;
	char s[N][100];
	for(i=0;i<N;i++)
  	gets(s[i]);
  	int a,b,c,d,last;
  	if(last=="AC")
  	a+1;
  	if(last=="WA")
  	b+1;
  	if(last=="TLE")
  	c+1;
  	if(last=="RE")
  	d+1;
  	cout<<"AC*"<<a;
  	cout<<"WA"<<b;
  	cout<<"TLE"<<c;
  	cout<<"RE*"<<d;
	return 0;
}