Problem: Your task is the exact same as for the easy version. But this time, the marmots subtract the village's population P from their random number before responding to Heidi's request.

Also, there are now villages with as few as a single inhabitant, meaning that <image>.

Can you help Heidi find out whether a village follows a Poisson or a uniform distribution?

Input

Same as for the easy and medium versions. But remember that now 1 ≤ P ≤ 1000 and that the marmots may provide positive as well as negative integers.

Output

Output one line per village, in the same order as provided in the input. The village's line shall state poisson if the village's distribution is of the Poisson type, and uniform if the answers came from a uniform distribution.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
template <class T>
int cntbit(T s) {
  return __builtin_popcnt(s);
}
template <class T>
T gcd(T a, T b) {
  T r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
string s, temp;
int test;
double a[5005];
double sqr(double x) { return x * x; }
int cal(double ave) {
  int res = (int)(ave);
  if (ave - res > 0.5) res++;
  return res;
}
void solve() {
  int n = 250;
  for (int i = (1); i <= (n); ++i) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  int number = 0;
  for (int i = (1); i <= (n); ++i) {
    if (a[i] >= a[n] * 0.8 - 1e-12) {
      number++;
    }
  }
  if (number >= 10) {
    if (a[n] >= 0) {
      int dem = 0;
      for (int i = (1); i <= (n); ++i) {
        if (a[i] <= a[n] * 0.2 + 1e-12 && a[i] >= 0) {
          dem++;
        }
      }
      if (dem > number + number + number) {
        cout << "poisson" << endl;
        return;
      }
    }
    cout << "uniform" << endl;
  } else {
    cout << "poisson" << endl;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> test;
  for (int itest = 0; itest < (test); ++itest) {
    solve();
  }
  return 0;
}