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

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using std::cerr;using std::cin;using std::cout;using std::abs;using std::min;using std::max;using std::swap;using std::map;using std::unordered_map;using std::unordered_set;using std::bitset;using std::pair;using std::set;using std::string;using std::vector;using std::sort;using ll=long long;using uint=unsigned int;using pii=pair<int,int>;using pll=pair<ll,ll>;using ull = unsigned long long;using ld=long double;template<typename T>void _(const char*s,T h){cerr<<s<<" = "<<h<<"\n";}template<typename T,typename...Ts>void _(const char*s,T h,Ts...t){int b=0;while(((b+=*s=='(')-=*s==')')!=0||*s!=',')cerr<<*s++;cerr<<" = "<<h<<",";_(s+1,t...);}// break continue pop_back 998244353
#define int ll
#define pii pll
#define f first
#define s second
#define pb emplace_back
#define forn(i,n) for(int i=0;i<(n);++i)
#define sqr(x) ((x)*(x))
struct init{init(){cin.tie(0);std::iostream::sync_with_stdio(0);cout<<std::fixed<<std::setprecision(10);cerr<<std::fixed<<std::setprecision(5);}~init(){
#ifdef LOCAL
#define dbg(...) _(#__VA_ARGS__,__VA_ARGS__)
cerr<<"Time elapsed: "<<(double)clock()/CLOCKS_PER_SEC<<"s.\n";
#else
#define dbg(...) 
#endif
}}init;template<typename T,typename U>void upx(T&x,U y){if(x<y)x=y;}template<typename T,typename U>void upn(T&x,U y){if(x>y)x=y;}

const int N=2020;
int a[N];
vector<pii> ans={{0,0}};
int n;
string pep(vector<int> v,int x){
    string res;
    if(v.back()>x){
        res+=char('a'+x);
        res+=pep(v,x+1);
        res+=char('a'+x);
    }else{
        assert(v.back()==x);
        if(v.size()>1){
            v.pop_back();
            auto s=pep(v,x+1);
            res+=char('A'+x);
            res+=s;
            res+=char('A'+x);
            reverse(s.begin(), s.end());
            res+=char('a'+x);
            res+=s;
            res+=char('a'+x);
        }else{
            res+=char('A'+x);
            res+=char('a'+x);
        }
    }
    return res;
}
void add(int mask){
    vector<int> v;
    forn(i,n)if(mask>>i&1)v.pb(i);
    reverse(v.begin(), v.end());
    dbg(mask);
    string s=pep(v,0);
    dbg(mask,s);
    int x=0,y=0;
    for(char c:s){
        dbg(x,y,c);
        if('a'<=c&&c<='z'){
            int r=c-'a';
            if(r==x){
                if(!y){
                    ans.pb(x+1,0);
                }else{
                    ans.pb(x,0);
                    ans.pb(x+1,0);
                }
            }else{
                assert(r==x-1);
                if(!y){
                    ans.pb(x-1,0);
                }else{
                    ans.pb(x,0);
                    ans.pb(x-1,0);
                }
            }
        }else{
            int r=c-'A';
            if(r==x){
                if(!y){
                    ans.pb(x,1);
                    ans.pb(x+1,1);
                }else{
                    ans.pb(x+1,1);
                }
            }else{
                assert(r==x-1);
                if(!y){
                    ans.pb(x,1);
                    ans.pb(x-1,1);
                }else{
                    ans.pb(x-1,1);
                }
            }
        }
        x=ans.back().f;
        y=ans.back().s;
    }
}
int32_t main(){

    cin>>n;
    forn(i,1<<n){
        char c;
        cin>>c;
        a[i]=c-'0';
    }
    int ok=1;
    vector<int> kek;
    forn(m1,1<<n){
        forn(m2,1<<n){
            if((m1&m2)==m2){
                if(!a[m2]&&a[m1])ok=0;
            }
        }
        if(!a[m1]){
            int kok=1;
            forn(m2,1<<n){
                if((m1&m2)==m2&&m1!=m2){
                    if(!a[m2])kok=0;
                }
            }
            if(kok)kek.pb(m1);
        }
    }
    if(!ok){
        cout<<"Impossible\n";
        return 0;
    }
    for(int i:kek)add(i);
    cout<<"Possible\n";
    cout<<ans.size()-1<<'\n';
    for(pii p:ans)cout<<p.f<<' '<<p.s<<'\n';

    return 0;
}