#include <bits/stdc++.h>
using namespace std;
const int N = 305;
int n, a[N][3], ok[N][3], CT[N];
vector<pair<int, int>> CD;
vector<int> server[4], canDeploy[8];
inline int msk(int s) { return a[s][0] + 2 * a[s][1] + 4 * a[s][2]; }
inline int msk2(int s) { return ok[s][0] + 2 * ok[s][1] + 4 * ok[s][2]; }
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < 3; j++) cin >> a[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < 3; j++) cin >> ok[i][j], ok[i][j] &= a[i][j];
  for (int i = 1; i <= n; i++) server[a[i][0] + a[i][1] + a[i][2]].push_back(i);
  for (auto &i : server[3]) {
    if (i == 1) continue;
    CD.push_back({1, i});
    CT[i] = 1;
    canDeploy[msk2(i)].push_back(i);
  }
  server[3].clear();
  while (1) {
    bool ok = 0;
    for (int i = 0; i < int(server[1].size()); i++)
      if (!canDeploy[msk(server[1][i])].empty()) {
        CD.push_back({canDeploy[msk(server[1][i])][0], server[1][i]});
        CT[server[1][i]] = 1;
        canDeploy[msk2(server[1][i])].push_back(server[1][i]);
        server[1].erase(server[1].begin() + i);
        --i;
        ok = 1;
      }
    for (int i = 0; i < int(server[2].size()); i++)
      if (!canDeploy[msk(server[2][i])].empty()) {
        CD.push_back({canDeploy[msk(server[2][i])][0], server[2][i]});
        CT[server[2][i]] = 1;
        canDeploy[msk2(server[2][i])].push_back(server[2][i]);
        server[2].erase(server[2].begin() + i), --i;
        ok = 1;
      }
    for (int i = 0; i < int(server[2].size()); i++) {
      int t1 = 0, t2 = 0, cur = server[2][i];
      for (int j = 0; j < 3; j++)
        if (a[cur][j]) {
          if (!t1)
            t1 = (1 << j);
          else
            t2 = (1 << j);
        }
      if (!canDeploy[t1].empty() && !canDeploy[t2].empty()) {
        ok = 1;
        CD.push_back({canDeploy[t1][0], cur});
        CD.push_back({canDeploy[t2][0], cur});
        canDeploy[msk(cur)].push_back(cur);
        server[2].erase(server[2].begin() + i);
        break;
      }
    }
    if (!ok) break;
  }
  if (server[1].size() + server[2].size() != 0) {
    cout << "Impossible" << endl;
    return 0;
  }
  cout << "Possible" << endl;
  for (int i = 1; i <= n; i++) cout << CT[i] << ' ';
  cout << endl;
  cout << CD.size() << endl;
  for (auto &i : CD) cout << i.first << ' ' << i.second << endl;
  return 0;
}
