t = int(input())

c1, c2, c3, c4 = 0, 0, 0, 0
for i in range(t):
	s = input()
	if s == 'AC':
		c1 += 1
	elif s == 'TLE':
		c2 += 1
	elif s == 'WA':
		c3 += 1
	else:
		c4 += 1
print('AC *', c1)
print('WA *', c3)
print('TLE *', c2)
print('RTE *', c4)