n = int(input())
lst = []
for i in range(n):
	str1 = input()
	lst.append(str1)
print('AC *' , lst.count('AC'))
print('WA *' , lst.count('WA'))
print('TLE *' ,lst.count('TLE'))
print('RE *' , lst.count('RE'))