#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, m, j;
  scanf("%d %d", &n, &m);
  long long int a[n][m], b[n][m];
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      scanf("%lld", &a[i][j]);
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      scanf("%lld", &b[i][j]);
    }
  }
  long long int count, o, val;
  count = 0;
  o = 0;
  for (i = 0; i < n; i++) {
    for (j = 1; j < m; j++) {
      if (a[i][j] > a[i][j - 1] && b[i][j] > b[i][j - 1]) {
        continue;
      } else {
        val = a[i][j];
        a[i][j] = b[i][j];
        b[i][j] = val;
        if (a[i][j] > a[i][j - 1] && b[i][j] > b[i][j - 1]) {
          continue;
        } else {
          printf("Impossible");
          count = 1;
          break;
        }
      }
    }
    if (count == 1) {
      break;
    }
  }
  if (count != 1) {
    for (i = 0; i < m; i++) {
      for (j = 1; j < n; j++) {
        if (a[j][i] > a[j - 1][i] && b[j][i] > b[j - 1][i]) {
          continue;
        } else {
          val = a[j][i];
          a[j][i] = b[j][i];
          b[j][i] = val;
          if (a[j][i] > a[j - 1][i] && b[j][i] > b[j - 1][i]) {
            continue;
          } else {
            printf("Impossible");
            o = 1;
            break;
          }
        }
      }
      if (o == 1) {
        break;
      }
    }
  }
  if (count != 1 && o != 1) {
    printf("Possible");
  }
  return 0;
}
