#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const int N = 1e6 + 9;
void solve() {
  int a, b, n;
  string s;
  cin >> s;
  char ch = s.back();
  if (ch == '3')
    cout << "bon";
  else if (ch == '0' || ch == '1' || ch == '6' || ch == '8')
    cout << "pon";
  else
    cout << "hon";
}
int main() {
  ios_base::sync_with_stdio(0);
  int T = 1, cas = 0;
  cin >> T;
  while (T--) {
    solve();
  }
  return 0;
}
