n = int(input())
s = []
for i in range(n):
    s.append(input())

ac = s.count('AC')
wa = s.count('WA')
tle = s.count('TLE')
re = s.count('RE')

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