n=int(input())
l=[]
for i in range(n):
  s=input()
  l.append(s)
  
ac=l.count('AC')
wa=l.count('WA')
tle=l.count('TLE')
re=l.count('RE')

print('AC ' +'x' + str(ac))
print('WA ' +'x' + str(wa))
print('TLE ' +'x' + str(tle))
print('RE ' +'x' + str(re))
