#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x){
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> T gcd(T a, T b){return !b?a:gcd(b,a%b);}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 266666;
Pii ans[N];int sz;
int n,a[N];
void solve(int S){
	vector<Pii> cur;bool first=1;
	per(i,n,1)if(S>>i-1&1){
		if(first){
			first=0;cur={mp(i,1),mp(i,0)};
		}
		else{
			vector<Pii>nxt={mp(i,1)};
			nxt.insert(nxt.end(),ALL(cur));
			nxt.pb(mp(i,1));
			nxt.pb(mp(i,0));
			per(i,SZ(cur)-1,0)nxt.pb(cur[i]);
			nxt.pb(mp(i,0));
			cur=nxt;
		}
	}
	else cur.insert(cur.begin(),mp(i,1)),cur.insert(cur.end(),mp(i,1));
	int x=0,y=1;
	for(auto i:cur){
	//	cerr<<i.fi<<' '<<i.se<<endl;
		if(y!=i.se)ans[++sz]=mp(x,y^1),y^=1;
		int tar=x<i.fi?i.fi:i.fi-1;
		while(x!=tar)ans[++sz]=mp(x+(tar>x?1:-1),y),x=ans[sz].fi;
	}
	Pii i(0,1);
	if(y!=i.se)ans[++sz]=mp(x,y^1),y^=1;
	while(x!=0)ans[++sz]=mp(x-1,y),x--;
}
void GG(){puts("Impossible");exit(0);}
int main() {
	char ss[1<<8|3];read(n);scanf("%s",ss);
	rep(i,0,(1<<n)-1)a[i]=ss[i]=='1';
	if(!a[0])GG();
	rep(s,1,(1<<n)-1)if(!a[s])rep(i,0,n-1)if(~s>>i&1)
		if(a[s^(1<<i)])GG();
	ans[++sz]=mp(0,1);
	rep(s,1,(1<<n)-1)if(!a[s]){
		bool ok=1;rep(i,0,n-1)if(s>>i&1)ok&=a[s^(1<<i)];
		if(ok)solve(s);
	}
	printf("Possible\n%d\n",sz-1);
	rep(i,1,sz)printf("%d %d\n",ans[i].fi,ans[i].se);
	return 0;
}

### Prompt

Your challenge is to write a cpp solution to the following problem:

Given are a positive integer N and a sequence of length 2^N consisting of 0s and 1s: A_0,A_1,\ldots,A_{2^N-1}. Determine whether there exists a closed curve C that satisfies the condition below for all 2^N sets S \subseteq \\{0,1,\ldots,N-1 \\}. If the answer is yes, construct one such closed curve.

* Let x = \sum_{i \in S} 2^i and B_S be the set of points \\{ (i+0.5,0.5) | i \in S \\}.
* If there is a way to continuously move the closed curve C without touching B_S so that every point on the closed curve has a negative y-coordinate, A_x = 1.
* If there is no such way, A_x = 0.



For instruction on printing a closed curve, see Output below.

Constraints

* 1 \leq N \leq 8
* A_i = 0,1 \quad (0 \leq i \leq 2^N-1)
* A_0 = 1

Input

Input is given from Standard Input in the following format:


N
A_0A_1 \cdots A_{2^N-1}


Output

If there is no closed curve that satisfies the condition, print `Impossible`.

If such a closed curve exists, print `Possible` in the first line. Then, print one such curve in the following format:


L
x_0 y_0
x_1 y_1
:
x_L y_L


This represents the closed polyline that passes (x_0,y_0),(x_1,y_1),\ldots,(x_L,y_L) in this order.

Here, all of the following must be satisfied:

* 0 \leq x_i \leq N, 0 \leq y_i \leq 1, and x_i, y_i are integers. (0 \leq i \leq L)
* |x_i-x_{i+1}| + |y_i-y_{i+1}| = 1. (0 \leq i \leq L-1)
* (x_0,y_0) = (x_L,y_L).



Additionally, the length of the closed curve L must satisfy 0 \leq L \leq 250000.

It can be proved that, if there is a closed curve that satisfies the condition in Problem Statement, there is also a closed curve that can be expressed in this format.

Examples

Input

1
10


Output

Possible
4
0 0
0 1
1 1
1 0
0 0


Input

2
1000


Output

Possible
6
1 0
2 0
2 1
1 1
0 1
0 0
1 0


Input

2
1001


Output

Impossible


Input

1
11


Output

Possible
0
1 1

### Response

```cpp
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x){
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> T gcd(T a, T b){return !b?a:gcd(b,a%b);}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 266666;
Pii ans[N];int sz;
int n,a[N];
void solve(int S){
	vector<Pii> cur;bool first=1;
	per(i,n,1)if(S>>i-1&1){
		if(first){
			first=0;cur={mp(i,1),mp(i,0)};
		}
		else{
			vector<Pii>nxt={mp(i,1)};
			nxt.insert(nxt.end(),ALL(cur));
			nxt.pb(mp(i,1));
			nxt.pb(mp(i,0));
			per(i,SZ(cur)-1,0)nxt.pb(cur[i]);
			nxt.pb(mp(i,0));
			cur=nxt;
		}
	}
	else cur.insert(cur.begin(),mp(i,1)),cur.insert(cur.end(),mp(i,1));
	int x=0,y=1;
	for(auto i:cur){
	//	cerr<<i.fi<<' '<<i.se<<endl;
		if(y!=i.se)ans[++sz]=mp(x,y^1),y^=1;
		int tar=x<i.fi?i.fi:i.fi-1;
		while(x!=tar)ans[++sz]=mp(x+(tar>x?1:-1),y),x=ans[sz].fi;
	}
	Pii i(0,1);
	if(y!=i.se)ans[++sz]=mp(x,y^1),y^=1;
	while(x!=0)ans[++sz]=mp(x-1,y),x--;
}
void GG(){puts("Impossible");exit(0);}
int main() {
	char ss[1<<8|3];read(n);scanf("%s",ss);
	rep(i,0,(1<<n)-1)a[i]=ss[i]=='1';
	if(!a[0])GG();
	rep(s,1,(1<<n)-1)if(!a[s])rep(i,0,n-1)if(~s>>i&1)
		if(a[s^(1<<i)])GG();
	ans[++sz]=mp(0,1);
	rep(s,1,(1<<n)-1)if(!a[s]){
		bool ok=1;rep(i,0,n-1)if(s>>i&1)ok&=a[s^(1<<i)];
		if(ok)solve(s);
	}
	printf("Possible\n%d\n",sz-1);
	rep(i,1,sz)printf("%d %d\n",ans[i].fi,ans[i].se);
	return 0;
}

```