#include <bits/stdc++.h>
using namespace std;
void faster() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const long long INF = 1e18;
const long long MOD = 998244353;
const long long MAXN = 6e5 + 1;
const long double EPS = 1e-12;
int binPow(int v, int u, int mod) {
  if (!u) return 1;
  int res = binPow(v, u / 2, mod);
  res = (res * 1ll * res) % mod;
  if (u & 1) res = (res * 1ll * v) % mod;
  return res;
}
int phi(int n) {
  int result = n;
  for (int i = 2; i * i <= n; ++i)
    if (n % i == 0) {
      while (n % i == 0) n /= i;
      result -= result / i;
    }
  if (n > 1) result -= result / n;
  return result;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int fib(int n) {
  int a = 0, b = 1;
  for (int i = 0; i < n; ++i) {
    b = b + a;
    a = b - a;
  }
  return b;
}
bool compare(const string &c1, const string &c2) {
  return c1.size() < c2.size();
}
string alph = "abcdefghijklmnopqrstuvwxyz";
int n;
void solve() {
  cin >> n;
  n %= 10;
  if (n == 3)
    cout << "b";
  else if (n == 0 || n == 1 || n == 6 || n == 8)
    cout << "p";
  else
    cout << "h";
  cout << "on\n";
}
int main() {
  faster();
  int T = 1;
  cin >> T;
  while (T--) {
    solve();
    cout << "\n";
  }
  return 0;
}
