n = int(input())
s = [input() for i in range(n)]
ac = s.count('AC')
wa = s.count('WA')
tle = s.count('TLE')
re = s.count('RE')

print('AC × '+str(ac))
print('WA × '+str(wa))
print('TLE × '+str(tle))
print('RE × '+str(re))