s=input()
if s[-1] in '24579':
  print('hon')
elif s[-1] in '0168':
  print('pon')
else:
  print('bon')
s=input()
if s[-1] in '24579':
  print('hon')
elif s[-1] in '0168':
  print('pon')
else:
  print('bon')