#include <bits/stdc++.h>
using namespace std;
const int N = 300;
int a[N], b[N], c[N], ct[N], vis[N];
vector<int> u, v;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 0, x; j < 3; j++) {
      cin >> x;
      a[i] |= (x << j);
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0, x; j < 3; j++) {
      cin >> x;
      b[i] |= (x << j);
    }
  }
  for (int i = 1; i <= n; i++) ct[i] = 1;
  c[7] = vis[1] = 1;
  while (1) {
    int ok = 0;
    for (int i = 1; i <= n; i++)
      if (!vis[i] && a[i]) {
        if (c[a[i]]) {
          ok = 1;
          u.push_back(c[a[i]]), v.push_back(i);
          vis[i] = 1;
          c[a[i] & b[i]] = i;
        } else {
          int need = (1 << 8) - 1;
          for (int j = 0; j < 1 << 8; j++) {
            int f = 1;
            for (int k = 0; k < 8; k++)
              if ((j >> k & 1) && (c[k] == 0)) f = 0;
            if (!f) continue;
            int x = 0;
            for (int k = 0; k < 8; k++)
              if (j >> k & 1) x |= k;
            if (x != a[i]) continue;
            if ((need & j) == j) need = j;
          }
          if (need == (1 << 8) - 1) continue;
          for (int j = 0; j < 8; j++) {
            if (need >> j & 1) u.push_back(c[j]), v.push_back(i);
          }
          ok = vis[i] = 1;
          if (c[a[i] & b[i]])
            c[a[i]] = i, ct[i] = 0;
          else
            c[a[i] & b[i]] = i;
        }
      }
    if (!ok) break;
  }
  int ok = 1;
  for (int i = 1; i <= n; i++)
    if (!vis[i] && a[i] != 0) ok = 0;
  if (ok)
    cout << "Possible" << endl;
  else
    cout << "Impossible" << endl;
  if (ok) {
    for (int i = 1; i <= n; i++) cout << ct[i] << ' ';
    cout << endl;
    cout << u.size() << endl;
    for (int i = 0; i < (int)u.size(); i++) {
      cout << u[i] << ' ' << v[i] << endl;
    }
  }
}
