program therefore
  implicit none
  integer :: n
  read(*,*) n
  select case(mod(n,10))
  case (3)
    write(*,'(a)') 'bon'
  case (0, 1, 6, 8)
    write(*,'(a)') 'pon'
  case default
    write(*,'(a)') 'hon'
  end select
end program therefore