#include <bits/stdc++.h>
#pragma warning(disable : 4996)
const long long MOD = 1000000007;
using namespace std;
int a[50][50];
int b[50][50];
void solve() {
  int n, m;
  scanf("%d%d", &n, &m);
  int i, j;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      scanf("%d", &b[i][j]);
      if (a[i][j] > b[i][j]) swap(a[i][j], b[i][j]);
    }
  }
  int bad = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (i > 0 && (a[i - 1][j] >= a[i][j] || b[i - 1][j] >= b[i][j])) bad = 1;
      if (j > 0 && (a[i][j - 1] >= a[i][j] || b[i][j - 1] >= b[i][j])) bad = 1;
    }
  }
  if (bad) {
    printf("Impossible\n");
  } else {
    printf("Possible\n");
  }
  return;
}
int main() {
  solve();
  return 0;
}
