n = int(input())
li = [0]*4
for _ in n:
  s = input()
  if s == 'AC':
    li[0]+=1
  elif s == 'WA':
    li[1]+=1
  elif s == 'TLE':
    li[2]+=1
  elif s == 'RE':
    li[3]+=1
print('AC x ',li[0])
print('WA x ',li[1])
print('TLE x ',li[2])
print('RE x ',li[3])