program therefore

 implicit none
 character::n
 integer::m

 read*,n
 m=len_trim(n)

 if(n(m:m)=='0'.or.n(m:m)=='1'.or.n(m:m)=='6'.or.n(m:m)=='8') then
  print*,'pon'
 else if(n(m:m)=='3') then
  print*,'bon'
 else
  print*,'hon'
 end if

end program therefore
 