#include <bits/stdc++.h>
using namespace std;
using namespace std;
const int N = 3e6 + 5;
int a[55][55], b[55][55], aa[55][55], bb[55][55];
int row(int x, int y) {
  for (int i = 1; i <= x; i++) {
    int k = 1;
    for (int j = 2; j <= y; j++) {
      if (a[i][j] > a[i][k]) {
        k = j;
      } else
        return 0;
    }
  }
  for (int i = 1; i <= x; i++) {
    int k = 1;
    for (int j = 2; j <= y; j++) {
      if (b[i][j] > b[i][k]) {
        k = j;
      } else
        return 0;
    }
  }
  return 1;
}
int col(int x, int y) {
  for (int i = 1; i <= y; i++) {
    int k = 1;
    for (int j = 2; j <= x; j++) {
      if (a[j][i] > a[k][i]) {
        k = j;
      } else
        return 0;
    }
  }
  for (int i = 1; i <= y; i++) {
    int k = 1;
    for (int j = 2; j <= x; j++) {
      if (b[j][i] > b[k][i]) {
        k = j;
      } else
        return 0;
    }
  }
  return 1;
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> aa[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> bb[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      a[i][j] = min(aa[i][j], bb[i][j]);
      b[i][j] = max(aa[i][j], bb[i][j]);
    }
  }
  if (row(n, m) && col(n, m))
    cout << "Possible";
  else
    cout << "Impossible";
  return 0;
}
