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.
#include <bits/stdc++.h>
using namespace std;
const int N = 255;
int T, a[N];
int main() {
  ios::sync_with_stdio(false);
  cin >> T;
  int tmp;
  while (T--) {
    double mean = 0, var = 0;
    for (int i = 1; i <= 250; i++) cin >> a[i], mean += a[i];
    mean /= 250;
    for (int i = 1; i <= 250; i++) var += (a[i] - mean) * (a[i] - mean);
    var /= 250;
    double dev = sqrt(var);
    if (*max_element(a + 1, a + 251) / dev > 1.93)
      puts("poisson");
    else
      puts("uniform");
  }
  return 0;
}
