n = int(input())
judge = list(int(input()) for _ in range(n))
ac, wa, tle, re = 0
for i in judge:
  if i == 'AC':
    ac = ac + 1
  elif i == 'WA':
    wa = wa + 1
  elif i == 'TLE':
    tle = tle + 1
  elif i == 'RE':
    re = re + 1
print('AC x ' + str(ac))
print('WA x ' + str(wa))
print('TLE x ' + str(tle))
print('RE x ' + str(re))