get_input(Number):-
    current_input(Input),
    read_string(Input, ' \n', '', _, String),
    number_string(Number, String). 

f(0, 'pon').
f(1, 'pon').
f(2, 'hon').
f(3, 'bon').
f(4, 'hon').
f(5, 'hon').
f(6, 'pon').
f(7, 'hon').
f(8, 'pon').
f(9, 'hon').

main:-
    get_input(A),
    N is A mod 10,
    f(N, R),
    writeln(R).
