#include <bits/stdc++.h>
using namespace std;
const int N = 333;
int n, a[N][3], b[N][3];
int ans[N];
vector<pair<int, int> > e;
vector<int> vec[8];
bool vis[8];
int nd[8];
bool solve() {
  for (int i = (1); i < (n + 1); ++i) ans[i] = 1;
  for (int i = (1); i < (n + 1); ++i) {
    int x = 0;
    for (int j = (0); j < (3); ++j) x = x * 2 + a[i][j];
    vec[x].push_back(i);
  }
  vector<int> que;
  for (int i = (1); i < ((int)vec[7].size()); ++i)
    e.push_back(make_pair(1, vec[7][i]));
  for (auto i : vec[7]) que.push_back(i);
  vis[7] = vis[0] = 1;
  for (int _ = (0); _ < ((int)que.size()); ++_) {
    int i = que[_];
    int x = 0;
    for (int j = (0); j < (3); ++j) x = x * 2 + (a[i][j] & b[i][j]);
    if (!vis[x]) {
      vis[x] = 1;
      for (auto j : vec[x]) e.push_back(make_pair(i, j)), que.push_back(j);
      nd[x] = i;
    }
  }
  for (int i = (0); i < (8); ++i)
    if (!vis[i]) {
      int cc = 0;
      for (int j = (0); j < (3); ++j) cc += i >> j & 1;
      if (cc == 1) {
        if ((int)vec[i].size()) return 0;
        continue;
      }
      if ((int)vec[i].size() == 0) continue;
      int u = i & (-i), v = i ^ u;
      if (vis[u] && vis[v]) {
        int tu = nd[u], tv = nd[v];
        int k = vec[i][0];
        ans[k] = 0;
        e.push_back(make_pair(tu, k));
        e.push_back(make_pair(tv, k));
        for (int j = (1); j < ((int)vec[i].size()); ++j)
          e.push_back(make_pair(k, vec[i][j]));
      } else {
        return 0;
      }
    }
  return 1;
}
int main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  cin >> n;
  for (int i = (1); i < (n + 1); ++i)
    for (int j = (0); j < (3); ++j) cin >> a[i][j];
  for (int i = (1); i < (n + 1); ++i)
    for (int j = (0); j < (3); ++j) cin >> b[i][j];
  if (solve()) {
    cout << "Possible" << '\n';
    for (int i = (1); i < (n + 1); ++i) cout << ans[i] << " \n"[i == n];
    cout << (int)e.size() << '\n';
    for (auto u : e) cout << u.first << " " << u.second << '\n';
  } else {
    cout << "Impossible" << '\n';
  }
  return 0;
}
