n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
  k = input().upper()
  if k == 'AC':
    ac +=1
  elif k == 'WA':
    wa +=1
  elif k == 'TLE':
    tle +=1
  elif k == 'RE':
    re +=1
    
print('AC x ' + ac + '\n' + 'WA x ' + wa + '\n' + 'TLE x ' + tle + '\n' + 'RE x ' + re)