#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<a<<endl
#define dumparr(a,n) cerr<<#a<<"["<<n<<"]="<<a[n]<<endl
#else
#define dump(a) 
#define dumparr(a,n) 
#endif
#define FOR(i, a, b) for(ll i = (ll)a;i < (ll)b;i++)
#define For(i, a) FOR(i, 0, a)
#define REV(i, a, b) for(ll i = (ll)b-1LL;i >= (ll)a;i--)
#define Rev(i, a) REV(i, 0, a)
#define REP(a) For(i, a)
#define SIGN(a) (a==0?0:(a>0?1:-1))

typedef long long int ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
typedef pair<ll,pll> ppll;
typedef vector<ll> vll;
typedef long double ld;
typedef pair<ld,ld> pdd;

const ll INF=(1LL<<50);
#if __cplusplus<201700L
ll gcd(ll a, ll b) {
  if(a < b) return gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
#endif
template<class T>
bool chmax(T& a,const T& b){
  if(a<b){
    a=b;
    return true;
  }
  return false;
}
template<class T>
bool chmin(T& a,const T& b){
  if(a>b){
    a=b;
    return true;
  }
  return false;
}
template<class S,class T>
std::ostream& operator<<(std::ostream& os,pair<S,T> a){
  os << "(" << a.first << "," << a.second << ")";
  return os;
}
template<class T>
std::ostream& operator<<(std::ostream& os,vector<T> a){
  os << "[ ";
  REP(a.size()){
    os<< a[i] << " ";
  }
  os<< " ]";
  return os;
}

const string YES = "Possible";
const string NO = "Impossible";
void pb(vector<pll> &ans,pll x){
  if((ans.size()>=2&&ans[ans.size()-2]==x)){
    ans.pop_back();
  }else if(ans.back()==x){
  }else{
    ans.push_back(x);
  }
}
void create1rev(vector<pll> &ans,ll x){
  REP(x+1){pb(ans,pll(1+i,0));}
  pb(ans,pll(x+1,1));
  pb(ans,pll(x,1));
  Rev(i,x+1){pb(ans,pll(i,0));}
}
void create1(vector<pll> &ans,ll x){
  REP(x){pb(ans,pll(1+i,0));}
  pb(ans,pll(x,1));
  pb(ans,pll(x+1,1));
  Rev(i,x+2){pb(ans,pll(i,0));}
}
void append2(vector<pll> &ans,ll x){
  vector<pll> cpy(ans);
  reverse(cpy.begin(),cpy.end());
  create1rev(ans,x);
  REP(cpy.size()){pb(ans,cpy[i]);}
  create1(ans,x);
}
void create2(vector<pll> &ans,set<ll> s){
  vector<pll> tmp{pll(0,0)};
  for (auto &&i : s)
  {
    if(tmp.size()==1){
      create1(tmp,i);
    }else{
      append2(tmp,i);
    }
    dump(tmp);
  }
  REP(tmp.size()){
    pb(ans,tmp[i]);
  }
}
ll two_factor(ll x){
  ll ret=0;
  while((1<<ret)!=x){
    ++ret;
  }
  return ret;
}
int main(){
  cout<<setprecision(1000);
  ll N;
  cin>>N;
  string A;
  cin>>A;
  vector<bool> first(A.size(),true);
  REP(A.size()){
    if(first[i]==false)continue;
    if(A[i]=='0')FOR(j,i+1,A.size()){
      if(((i&j)==i)&&A[j]=='1'){
        cout<<NO<<endl;
        return 0;
      }else if((i&j)==i){
        first[j]=false;
      }
    }else{
      first[i]=false;
    }
  }
  dump(first);
  vector<pll> ans{pll(0,0)};
  REP(A.size()){
    if(first[i]){
      if(__builtin_popcountll(i)==1){
        create1(ans,two_factor(i));
      }else{
        set<ll> s;
        For(j,N){
          if((1<<j)&i){
            s.insert(j);
          }
        }
        create2(ans,move(s));
      }
    }
  }
  if(ans.size()>250001){
    abort();
  }
  cout<<YES<<endl;
  cout<<ans.size()-1<<endl;
  REP(ans.size()){
    cout<<ans[i].first<<" "<<ans[i].second<<endl;
  }
  return 0;
}


Measured memory_bytes: 640