n= int(input())


l=[]

for i in range(n):
    l.append(input())
    l.sort()

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






