#include <bits/stdc++.h>
using namespace std;
const int N = 256, K = 3;
int a[N], b[N], c[1 << K], sz[1 << K], ct[N];
bool used[N];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < K; j++) {
      int x;
      cin >> x;
      a[i] |= x << j;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < K; j++) {
      int x;
      cin >> x;
      b[i] |= x << j;
    }
  }
  for (int i = 0; i < (1 << K); i++) {
    for (int j = 0; j < K; j++) {
      sz[i] += ((i >> j) & 1);
    }
  }
  memset(c, -1, sizeof(c));
  c[(1 << K) - 1] = 0;
  used[0] = 1;
  vector<pair<int, int>> v;
  fill(ct, ct + n, 1);
  bool work = true;
  while (work) {
    work = false;
    for (int i = 0; i < n; i++) {
      if (a[i] == 0) {
        used[i] = 1;
      }
      if (!used[i] && c[a[i]] != -1) {
        v.push_back({c[a[i]], i});
        used[i] = 1;
        if (c[b[i] & a[i]] == -1) {
          c[b[i] & a[i]] = i;
          work = true;
        }
      }
    }
  }
  for (int j = 0; j < n; j++) {
    if (!used[j]) {
      if (c[a[j]] != -1) {
        v.push_back({c[a[j]], j});
        used[j] = 1;
      } else {
        int z = 0;
        for (int k = 0; k < K; k++) {
          if (((a[j] >> k) & 1) && c[1 << k] != -1) {
            z++;
          }
        }
        if (z == sz[a[j]]) {
          for (int k = 0; k < K; k++) {
            if (((a[j] >> k) & 1) && c[1 << k] != -1) {
              v.push_back({c[1 << k], j});
            }
          }
          ct[j] = 0;
          used[j] = 1;
          if (c[a[j]] == -1) {
            c[a[j]] = j;
          }
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (!used[i]) {
      cout << "Impossible";
      return 0;
    }
  }
  cout << "Possible\n";
  for (int i = 0; i < n; i++) {
    cout << ct[i] << " ";
  }
  cout << "\n";
  cout << v.size() << "\n";
  for (auto p : v) cout << p.first + 1 << " " << p.second + 1 << "\n";
  return 0;
}
