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;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
const int N = 251;
const int P = 1005;
const double e = 2.718281828459045235360287471352;
int a[N];
double tp1[P << 1], tp2[P << 1];
int main() {
  int T = read();
  while (T--) {
    int mx = 0;
    double mean = 0;
    for (int i = 1; i <= 250; i++)
      a[i] = read(), mean += a[i], mx = max(mx, a[i]);
    double D = 0;
    mean /= 250;
    for (int i = 1; i <= 250; i++) D += a[i] * a[i];
    D /= (double)250;
    D -= mean * mean;
    double sigma = sqrt(D);
    if (mx / sigma <= 1.9)
      puts("uniform");
    else
      puts("poisson");
  }
  return 0;
}