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;
const int Imx = 2147483647;
const int mod = 1000000007;
const long long Lbig = 2e18;
inline long long getnum() {
  register long long r = 0;
  register bool ng = 0;
  register char c;
  c = getchar();
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') ng = 1, c = getchar();
  while (c >= '0' && c <= '9') r = r * 10 + c - '0', c = getchar();
  if (ng) r = -r;
  return r;
}
template <class T>
inline void putnum(T x) {
  if (x < 0) putchar('-'), x = -x;
  register short a[20] = {}, sz = 0;
  while (x > 0) a[sz++] = x % 10, x /= 10;
  if (sz == 0) putchar('0');
  for (int i = sz - 1; i >= 0; i--) putchar('0' + a[i]);
}
inline void putsp() { putchar(' '); }
inline void putendl() { putchar('\n'); }
inline char mygetchar() {
  register char c = getchar();
  while (c == ' ' || c == '\n') c = getchar();
  return c;
}
int Tn;
double a[255];
int cnt[1011];
void solve() {
  memset(cnt, 0, sizeof(cnt));
  double mn = 0, mx = 0;
  for (int i = 1; i <= 250; i++) {
    a[i] = getnum();
    mn = min(mn, a[i]);
    mx = max(mx, a[i]);
  }
  for (int i = 1; i <= 250; i++) a[i] = 1.0 * (a[i] - mn) / (mx - mn);
  double av = 0, sum = 0;
  for (int i = 1; i <= 250; i++) av += a[i];
  av /= 250;
  for (int i = 1; i <= 250; i++)
    sum += (a[i] - av) * (a[i] - av) * (a[i] - av) * (a[i] - av);
  if (sum < 1.9)
    puts("poisson");
  else
    puts("uniform");
}
int main() {
  Tn = getnum();
  while (Tn--) {
    solve();
  }
  return 0;
}