#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1.0);
long long n, m;
long long a[55][55], b[55][55];
void solve() {
  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) {
    long long prev = 0;
    for (long long j = 0; j < m; ++j) {
      if (a[i][j] > prev) {
        prev = a[i][j];
      } else {
        cout << "Impossible" << '\n';
        return;
      }
    }
  }
  for (long long i = 0; i < n; ++i) {
    long long prev = 0;
    for (long long j = 0; j < m; ++j) {
      if (b[i][j] > prev) {
        prev = b[i][j];
      } else {
        cout << "Impossible" << '\n';
        return;
      }
    }
  }
  for (long long j = 0; j < m; ++j) {
    long long prev = 0;
    for (long long i = 0; i < n; ++i) {
      if (a[i][j] > prev) {
        prev = a[i][j];
      } else {
        cout << "Impossible" << '\n';
        return;
      }
    }
  }
  for (long long j = 0; j < m; ++j) {
    long long prev = 0;
    for (long long i = 0; i < n; ++i) {
      if (b[i][j] > prev) {
        prev = b[i][j];
      } else {
        cout << "Impossible" << '\n';
        return;
      }
    }
  }
  cout << "Possible" << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
