#include <bits/stdc++.h>
using namespace std;
namespace zyt {
template <typename T>
inline bool read(T &x) {
  char c;
  bool f = false;
  x = 0;
  do c = getchar();
  while (c != EOF && c != '-' && !isdigit(c));
  if (c == EOF) return false;
  if (c == '-') f = true, c = getchar();
  do x = x * 10 + c - '0', c = getchar();
  while (isdigit(c));
  if (f) x = -x;
  return true;
}
template <typename T>
inline void write(T x) {
  static char buf[20];
  char *pos = buf;
  if (x < 0) putchar('-'), x = -x;
  do *pos++ = x % 10 + '0';
  while (x /= 10);
  while (pos > buf) putchar(*--pos);
}
const int N = 260;
int n, a[N], cnt, b[N];
bool mark[N], vis[N], viss[8];
pair<int, int> ans[N];
void dfs(const int x) {
  viss[a[x]] = viss[b[x]] = true;
  vis[x] = true;
  for (int i = 1; i <= n; i++)
    if (!vis[i] && a[i] == b[x]) ans[cnt++] = pair<int, int>(x, i), dfs(i);
}
bool solve(const int x, const int y, const int z) {
  if (!viss[y] || !viss[z]) return false;
  bool f = false;
  for (int i = 1; i <= n && !f; i++)
    if (vis[i] && (a[i] == y || (!mark[i] && b[i] == y)))
      ans[cnt++] = pair<int, int>(i, x), f = true;
  f = false;
  for (int i = 1; i <= n && !f; i++)
    if (vis[i] && (a[i] == z || (!mark[i] && b[i] == z)))
      ans[cnt++] = pair<int, int>(i, x), f = true;
  for (int i = 1; i <= n; i++)
    if (i != x && a[i] == a[x])
      ans[cnt++] = pair<int, int>(x, i), vis[i] = true;
  return true;
}
int work() {
  read(n);
  for (int i = 1; i <= n; i++) {
    int t = 0;
    for (int j = 0; j < 3; j++) {
      int x;
      read(x);
      t = t * 2 + x;
    }
    a[i] = t;
    if (!t)
      vis[i] = true;
    else if (t == 1 || t == 2 || t == 4)
      mark[i] = true;
    else
      mark[i] = false;
  }
  for (int i = 1; i <= n; i++) {
    int t = 0;
    for (int j = 0; j < 3; j++) {
      int x;
      read(x);
      t = t * 2 + x;
    }
    b[i] = (t & a[i]);
  }
  dfs(1);
  for (int i = 1; i <= n; i++)
    if (!vis[i]) {
      bool flag = false;
      if (a[i] == 3)
        flag = solve(i, 1, 2);
      else if (a[i] == 5)
        flag = solve(i, 1, 4);
      else if (a[i] == 6)
        flag = solve(i, 2, 4);
      if (flag)
        vis[i] = mark[i] = true;
      else {
        puts("Impossible");
        return 0;
      }
    }
  puts("Possible");
  for (int i = 1; i <= n; i++)
    if (mark[i])
      write(0), putchar(' ');
    else
      write(1), putchar(' ');
  putchar('\n');
  write(cnt), putchar('\n');
  for (int i = 0; i < cnt; i++)
    write(ans[i].first), putchar(' '), write(ans[i].second), putchar('\n');
  return 0;
}
}  // namespace zyt
int main() { return zyt::work(); }
