Problem:
Score : 1000 points

Problem Statement

There are N oases on a number line. The coordinate of the i-th oases from the left is x_i.

Camel hopes to visit all these oases.
Initially, the volume of the hump on his back is V. When the volume of the hump is v, water of volume at most v can be stored. Water is only supplied at oases. He can get as much water as he can store at a oasis, and the same oasis can be used any number of times.

Camel can travel on the line by either walking or jumping:

Walking over a distance of d costs water of volume d from the hump. A walk that leads to a negative amount of stored water cannot be done.

Let v be the amount of water stored at the moment. When v>0, Camel can jump to any point on the line of his choice. After this move, the volume of the hump becomes v/2 (rounded down to the nearest integer), and the amount of stored water becomes 0.

For each of the oases, determine whether it is possible to start from that oasis and visit all the oases.

Constraints

2 ≤ N,V ≤ 2 × 10^5

-10^9 ≤ x_1 < x_2 < ... < x_N ≤ 10^9

V and x_i are all integers.

Input

Input is given from Standard Input in the following format:

N V
x_1 x_2 ... x_{N}

Output

Print N lines. The i-th line should contain Possible if it is possible to start from the i-th oasis and visit all the oases, and Impossible otherwise.

Sample Input 1

3 2
1 3 6

Sample Output 1

Possible
Possible
Possible

It is possible to start from the first oasis and visit all the oases, as follows:

Walk from the first oasis to the second oasis. The amount of stored water becomes 0.

Get water at the second oasis. The amount of stored water becomes 2.

Jump from the second oasis to the third oasis. The amount of stored water becomes 0, and the volume of the hump becomes 1.

Sample Input 2

7 2
-10 -4 -2 0 2 4 10

Sample Output 2

Impossible
Possible
Possible
Possible
Possible
Possible
Impossible

A oasis may be visited any number of times.

Sample Input 3

16 19
-49 -48 -33 -30 -21 -14 0 15 19 23 44 52 80 81 82 84

Sample Output 3

Possible
Possible
Possible
Possible
Possible
Possible
Possible
Possible
Possible
Possible
Possible
Possible
Impossible
Impossible
Impossible
Impossible

Solution in C++14 (GCC 5.4.1) (judge verdict: Accepted)

// This amazing code is by Eric Sunli Chen.
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
template<typename T> void get_int(T &x)
{
	char t=getchar();
	bool neg=false;
	x=0;
	for(; (t>'9'||t<'0')&&t!='-'; t=getchar());
	if(t=='-')neg=true,t=getchar();
	for(; t<='9'&&t>='0'; t=getchar())x=x*10+t-'0';
	if(neg)x=-x;
}
template<typename T> void print_int(T x)
{
	if(x<0)putchar('-'),x=-x;
	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]);
}
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define get1(a) get_int(a)
#define get2(a,b) get1(a),get1(b)
#define get3(a,b,c) get1(a),get2(b,c)
#define printendl(a) print_int(a),puts("")
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
const int inf=0x3f3f3f3f;
const LL Linf=1ll<<61;
const double pi=acos(-1.0);

int n,v,a[200111],nxt[20][200111],pre[20][200111],k,v2[20],dp1[1<<20],dp2[1<<20];
bool ans[200111];

int main()
{
	get2(n,v);
	int tmp=v;
	while(tmp)
	{
		v2[k++]=tmp;
		tmp>>=1;
	}
	v2[k++]=0;reverse(v2,v2+k);
	for(int i=1;i<=n;i++)get1(a[i]);
	for(int i=0;i<k;i++)
	{
		nxt[i][n+1]=n+1;pre[i][0]=0;
		for(int j=1,j2;j<=n;j=j2)
		{
			j2=j+1;
			while(j2<=n&&a[j2]-a[j2-1]<=v2[i])j2++;
			for(int t=j;t<j2;t++)
			{
				nxt[i][t]=j2;
				pre[i][t]=j-1;
			}
		}
	}
	
	for(int i=0;i<(1<<k-1);i++)
	{
		dp1[i]=1;
		dp2[i]=n;
	}
	for(int i=0;i<(1<<k-1);i++)
	{
		for(int j=0;j<k-1;j++)if(((i>>j)&1)==0)
		{
			dp1[i^(1<<j)]=max(dp1[i^(1<<j)],nxt[j][dp1[i]]);
			dp2[i^(1<<j)]=min(dp2[i^(1<<j)],pre[j][dp2[i]]);
		}
	}
	if(dp1[(1<<k-1)-1]==n+1)
	{
		for(int i=1;i<=n;i++)puts("Possible");
		return 0;
	}
	int all=(1<<k-1)-1;
	for(int i=0;i<(1<<k-1);i++)if(dp2[all^i]<nxt[k-1][dp1[i]])ans[dp1[i]]=1;
	for(int i=1;i<=n;i=nxt[k-1][i])
	{
		for(int j=i;j<nxt[k-1][i];j++)
		{
			if(ans[i])puts("Possible");
			else puts("Impossible");
		}
	}
	return 0;
}