#include <bits/stdc++.h>
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

// U1, D1, U2, D2, D1, U1, U2, D3, U3, U2, U3, D3, U2

/*
N = 2
U2, U1, D1, U2, D2, D1, U1, D2

N = 3
U3, U2, U1, D1, U2, D2, D1, U1, D2, U3, D3, D2, U1, D1, D2, U2, D1, U1, U2, D3
-->                                 <---->                                  <--

S -> UN, S, UN, DN, rev(S), DN

L -> 2L+4

O(2^N)

{0, 3, 4} -> NO     S1
{1, 3} -> NO        S2

S1 + S2

{0, 2, 3} -> YES
* */

void impossible() {
	puts("Impossible");
	exit(0);
}

const int UP = 0, DOWN = 1;
vector<pair<int,int>> rec(vector<int> group) {
	if(group.empty()) {
		return {};
	}
	int last = group.back();
	group.pop_back();
	vector<pair<int,int>> s = rec(group);
	// S -> UN, S, UN, DN, rev(S), DN
	vector<pair<int,int>> total;
	if(!s.empty()) total.emplace_back(last, UP);
	for(auto p : s) {
		total.push_back(p);
	}
	total.emplace_back(last, UP);
	total.emplace_back(last, DOWN);
	reverse(s.begin(), s.end());
	for(auto p : s) {
		total.push_back(p);
	}
	if(!s.empty()) total.emplace_back(last, DOWN);
	return total;
}

int main() {
	int n;
	cin >> n;
	string s;
	cin >> s;
	vector<bool> possible(1 << n);
	for(int mask = 0; mask < (1 << n); ++mask) {
		possible[mask] = (s[mask] == '1');
	}
	// minimal subsets that give answer NO
	vector<int> minimal;
	for(int mask = 0; mask < (1 << n); ++mask) {
		if(!possible[mask]) {
			bool is_minimal = true;
			for(int bit = 0; bit < n; ++bit) {
				if(mask & (1 << bit)) {
					if(!possible[mask ^ (1 << bit)]) {
						is_minimal = false;
					}
				}
			}
			if(is_minimal) {
				minimal.push_back(mask);
			}
		}
	}
	for(int x : minimal) {
		for(int y : minimal) {
			if(x != y && ((x & y) == y)) {
				impossible();
			}
		}
	}
	for(int mask = 0; mask < (1 << n); ++mask) {
		bool contains = false;
		for(int x : minimal) {
			if((mask & x) == x) {
				contains = true;
			}
		}
		if(contains == possible[mask]) {
			impossible();
		}
	}
	puts("Possible");
	debug() << imie(minimal);
	pair<int,int> me{0, 0};
	vector<pair<int,int>> answer;
	answer.push_back(me);
	auto f = [&](int x, int y) {
		assert(me.first == x || me.second == y);
		assert(me != make_pair(x, y));
		for(int i = me.first + 1; i < x; ++i) {
			answer.emplace_back(i, me.second);
		}
		for(int i = me.first - 1; i > x; --i) {
			answer.emplace_back(i, me.second);
		}
		me = {x, y};
		answer.push_back(me);
	};
	for(int mask : minimal) {
		vector<int> group;
		for(int bit = 0; bit < n; ++bit) {
			if(mask & (1 << bit)) {
				group.push_back(bit);
			}
		}
		reverse(group.begin(), group.end());
		vector<pair<int,int>> moves = rec(group);
		debug() << imie(moves);
		for(pair<int,int> move : moves) {
			int x = move.first;
			int type = move.second;
			if(me.first < x) {
				f(x, 0);
			}
			else if(me.first > x + 1) {
				f(x + 1, 0);
			}
			if(type == UP) {
				f(me.first, 1);
				f(x + x + 1 - me.first, 1);
				f(me.first, 0);
			}
			else {
				f(x + x + 1 - me.first, 0);
			}
		}
		if(me != make_pair(0, 0)) {
			f(0, 0);
		}
	}
	printf("%d\n", (int) answer.size() - 1);
	for(pair<int,int> p : answer) {
		printf("%d %d\n", p.first, p.second);
	}
}

// U1, U0, D0, U1, D1, D0, U0, D1


Measured memory_bytes: 512