#include <bits/stdc++.h>
using namespace std;

void fail(){
	cout << "Impossible" << '\n';
	exit(0);
}

mt19937 mt(48);

vector<int> inv(vector<int> x){
	reverse(x.begin(), x.end());
	for(int& a : x) a = -a;
	return x;
}

vector<int> make(vector<int> val){
	if(val.size() == 1){
		int f = mt() & 4;
		f -= 2;
		if(f == 0) f++;
		vector<int> x;
		if(f < 0){
			for(int r = 0; r < -f; r++) x.push_back(-val.front());
		} else {
			for(int r = 0; r < f; r++) x.push_back(val.front());			
		}
		return x;
	}
	vector<int> nval[2];
	vector<int> nx[2];
	for(int i = 0; i < (int)val.size(); i++){
		nval[i & 1].push_back(val[i]);
	}
	nx[0] = make(nval[0]);
	nx[1] = make(nval[1]);
	vector<int> x;
	for(int r : nx[0]) x.push_back(r);
	for(int r : nx[1]) x.push_back(r);
	for(int r : inv(nx[0])) x.push_back(r);
	for(int r : inv(nx[1])) x.push_back(r);
	return x;
}

void pr(vector<int> x){
	vector<pair<int,int> > path;
	path.push_back({0, 0});
	for(int f : x){
		int c = 0;
		int val = abs(f) - 1;
		while(c < val){
			c++;
			path.push_back({c, 0});
		}
		if(f > 0){
			path.push_back({c, 1});
			path.push_back({c+1, 1});
			path.push_back({c+1, 0});
			path.push_back({c, 0});
		} else {
			path.push_back({c+1, 0});
			path.push_back({c+1, 1});
			path.push_back({c, 1});
			path.push_back({c, 0});
		}
		while(c > 0){
			c--;
			path.push_back({c, 0});
		}
	}
	cout << "Possible" << '\n';
	cout << (int)path.size() - 1 << '\n';
	for(pair<int,int> a : path){
		cout << a.first << ' ' << a.second << '\n';
	}
}

int main(){
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n;
	cin >> n;
	int N = (1 << n);
	string s(N, '0');
	cin >> s;
	// for(int j = 0; j < N; j++){
	// 	s[j] = "01"[(__builtin_popcount(j | (j >> 1)) <= 3)];
	// }

	for(int i = 0; i < N; i++){
		for(int j = 0; j < N; j++){
			if((i & j) == i){
				if(s[i] < s[j]){
					fail();
				}
			}
		}
	}
	vector<vector<int> > q;
	for(int i = 0; i < N; i++){
		if(s[i] == '1') continue;
		vector<int> val;
		bool fail = false;
		for(int j = 0; j < n; j++){
			if((i >> j) & 1){
				val.push_back((j+1));
				if(s[i ^ (1 << j)] == '0') fail = true;
			}
		}
		if(fail) continue;
		shuffle(val.begin(), val.end(), mt);
		q.push_back(val);
	}
	while(true){
		vector<int> ans;
		shuffle(q.begin(), q.end(), mt);
		for(vector<int> val : q){
			vector<int> z = make(val);
			for(int v : z) ans.push_back(v);
		}
		bool works = true;
		for(int j = 0; j < N; j++){
			vector<int> stk = {0};
			for(int f : ans){
				if((j >> (abs(f) - 1)) & 1){
					if(stk.back() == -f){
						stk.pop_back();
					} else {
						stk.push_back(f);
					}
				}
			}
			int wins = (stk.size() == 1);
			if(wins != s[j] - '0'){
				cerr << j << ' ' << wins << ' ' << (s[j] - '0') << '\n';
				works = false;
			}
		}
		if(!works) continue;
		cerr << ans.size() << '\n';
		for(int x : ans){
			cerr << x << ' ';
		}
		cerr << '\n';
		pr(ans);
		exit(0);
	}
}