N=int(input())
test_case=[input() for _ in range(N)]
a=test_case.count('AC')
b=test_case.count('WA')
c=test_case.count('TLE')
d=test_case.count('RE')
print('AC x '+a)
print('WA x '+b)
print('TLE x '+c)
print('RE x '+d)
