n=int(input())
l=[0,0,0,0]
for _ in range(n):
	s=input()
	if(s=='AC'):
		l[0]+=1
	elif(s=='WA'):
		l[1]+=1
	elif(s=='TLE'):
		l[2]+=1
	elif(s=='RE'):
		l[3]+=1
print("AC X",l[0])
print("WA X",l[1])
print("TLE X",l[2])
print("RE X",l[3])