#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
template <class T, class U>
void chmin(T& t, const U& u) {
  if (u < t) t = u;
}
template <class T, class U>
void chmax(T& t, const U& u) {
  if (t < u) t = u;
}
template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  return os << "P(" << p.first << ", " << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& os, const V<T>& v) {
  os << "[";
  for (auto d : v) os << d << ", ";
  return os << "]";
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  int N;
  cin >> N;
  V<int> tar(N), fil(N);
  for (int i = 0; i < (int)(N); i++) {
    int x = 0;
    for (int j = 0; j < (int)(3); j++) {
      int a;
      cin >> a;
      if (a) x |= 1 << j;
    }
    tar[i] = x;
  }
  for (int i = 0; i < (int)(N); i++) {
    int x = 0;
    for (int j = 0; j < (int)(3); j++) {
      int a;
      cin >> a;
      if (a) x |= 1 << j;
    }
    fil[i] = x;
  }
  V<int> cand(8, -1);
  cand[7] = 0;
  V<bool> done(N);
  done[0] = true;
  V<bool> ON(N);
  for (int i = 0; i < (int)(N); i++)
    if (tar[i] == 0) done[i] = true;
  using P = pair<int, int>;
  V<P> es;
  auto ADD = [&](int x, int y) {
    es.emplace_back(x, y);
    ON[y] = true;
    int b = tar[y] & fil[y];
    if (cand[b] == -1) {
      cand[b] = y;
      ON[y] = true;
    }
    done[y] = true;
  };
  auto ADD2 = [&](int x, int y, int z) {
    es.emplace_back(x, z);
    es.emplace_back(y, z);
    cand[tar[z]] = z;
    done[z] = true;
  };
  while (true) {
    bool update = false;
    for (int i = 0; i < (int)(N); i++)
      if (!done[i] && cand[tar[i]] != -1) {
        ADD(cand[tar[i]], i);
        update = true;
        break;
      }
    if (update) continue;
    for (int i = 0; i < (int)(N); i++)
      if (!done[i] && __builtin_popcount(tar[i]) == 2) {
        V<int> m;
        for (int j = 0; j < (int)(3); j++)
          if ((tar[i] >> j) & 1) {
            if (cand[1 << j] != -1) m.push_back(cand[1 << j]);
          }
        if ((int)m.size() != 2) continue;
        ADD2(m[0], m[1], i);
        update = true;
        break;
      }
    if (!update) break;
  }
  for (int i = 0; i < (int)(N); i++) {
    if (!done[i]) {
      cout << "Impossible" << endl;
      return 0;
    }
  }
  cout << "Possible" << endl;
  for (int i = 0; i < (int)(N); i++) cout << ON[i] << " ";
  cout << endl;
  cout << es.size() << endl;
  for (P p : es) cout << p.first + 1 << " " << p.second + 1 << endl;
}
