#include <bits/stdc++.h>
using namespace std;
long long a[55][55], b[55][55];
bool ch(long long i, long long j, long long f) {
  if (f == 1) {
    if (i > 0 && a[i][j] <= a[i - 1][j]) return false;
    if (j > 0 && a[i][j] <= a[i][j - 1]) return false;
  } else {
    if (i > 0 && b[i][j] <= b[i - 1][j]) return false;
    if (j > 0 && b[i][j] <= b[i][j - 1]) return false;
  }
  return true;
}
int main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cin >> b[i][j];
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (a[i][j] > b[i][j]) {
        swap(a[i][j], b[i][j]);
      }
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (!(ch(i, j, 1) && ch(i, j, 2))) {
        cout << "Impossible" << endl;
        return 0;
      }
    }
  }
  cout << "Possible" << endl;
  return 0;
}
