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 maxn = (int)250 + 9;
const int M = 30;
const long long mod = 1000000007;
const double eps = 1e-14;
int v;
int p[maxn];
void init() {
  for (int i = 0; i < 250; i++) {
    scanf("%d", &p[i]);
  }
}
int main() {
  scanf("%d", &v);
  while (v--) {
    init();
    double e = 0;
    double d = 0;
    for (int i = 0; i < 250; i++) {
      d += (p[i] - e) * (p[i] - e) / 250;
    }
    double s = sqrt(d);
    int cnt = 0;
    for (int i = 0; i < 250; i++) {
      if (abs(p[i]) < 2 * s) {
        cnt++;
      }
    }
    if (cnt < 250) {
      printf("poisson\n");
    } else {
      printf("uniform\n");
    }
  }
  return 0;
}