n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
  string = input()
  if string == 'AC':
    ac += 1
  elif string == 'WA':
    wa += 1
  elif string == 'TLE':
    tle += 1
  else:
    re += 1
print('AC X',ac)
print('WA X',ac)
print('TLE X',ac)
print('RE X',ac)