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

print(n, s)
ac = s.count('AC')
wa = s.count('WA')
tle = s.count('TLE')
re = s.count('RE')
print('AC'+' '+'x'+' '+str(ac))
print('WA'+' '+'x'+' '+str(wa))
print('TLE'+' '+'x'+' '+str(tle))
print('RE'+' '+'x'+' '+str(re))



