N=int(input())
list = [input() for i in range(N)]
print('AC x ' + str(list.count('AC')))
print('WA x ' + str(list.count('WA')))
print('TLE x ' + str(list.count('TLE')))
print('RA x ' + str(list.count('RA')))