#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> edge;
vector<int> g[20];
int msk[310], tag[310], T[310], pos[20], n;
int getmsk() {
  int x = 0;
  for (int i = 1; i <= 3; ++i) {
    int y;
    scanf("%d", &y);
    x = (x << 1) + y;
  }
  return x;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) msk[i] = getmsk();
  for (int i = 1; i <= n; ++i) tag[i] = getmsk();
  for (int i = 1; i <= n; ++i)
    if (i != 1) g[msk[i]].push_back(i);
  pos[7] = 1;
  for (;;) {
    bool flag = 0;
    for (int i = 1; i <= 7; ++i)
      if (g[i].size() && pos[i]) {
        for (auto j : g[i]) {
          edge.push_back(make_pair(pos[i], j));
          T[j] = 1;
          if (!pos[tag[j] & i]) pos[tag[j] & i] = j;
          flag = 1;
        }
        g[i].clear();
      }
    if (!flag) break;
  }
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < i; j++)
      if (pos[1 << i] && pos[1 << j] && !pos[(1 << i) + (1 << j)] &&
          g[(1 << i) + (1 << j)].size()) {
        int mk = (1 << i) + (1 << j), x = pos[1 << i], y = pos[1 << j];
        int cnt = g[mk].size();
        edge.push_back(make_pair(x, g[mk][0]));
        edge.push_back(make_pair(y, g[mk][0]));
        for (int k = 1; k < cnt; k++)
          edge.push_back(make_pair(g[mk][0], g[mk][k]));
        g[mk].clear();
      }
  for (int i = 1; i <= 7; ++i)
    if (g[i].size()) {
      puts("Impossible");
      return 0;
    }
  puts("Possible");
  for (int i = 1; i <= n; ++i) printf("%d%c", T[i], " \n"[i == n]);
  printf("%d\n", edge.size());
  for (auto i : edge) printf("%d %d\n", i.first, i.second);
  return 0;
}
