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', x, ac)
print('WA', x, wa)
print('TLE', x, tle)
print('RE', x, re)