N = int(input())

d = {'AC':0,'WA':0,'TLE':0,'RE':0}

for i in range(N):
  wrk = input()
  d[wrk] = d[wrk]+1

print('AC X ',d['AC'])
print('WA x ',d['WA'])
print('TLE x ',d['TLE'])
print('RE x ',d['RE'])