#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll fpow(ll b, ll p, ll m) {
  if (p == 0) return 1;
  ll t = fpow(b, p / 2, m);
  if (p % 2) return t * t % m * b % m;
  return t * t % m;
}
ll fpow(ll b, ll p) {
  if (p == 0) return 1;
  ll t = fpow(b, p / 2);
  if (p % 2) return t * t * b;
  return t * t;
}
bool cmp(ll a, ll b) { return a > b; }
ll a[55][55], b[55][55];
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll r, c;
  cin >> r >> c;
  for (ll i = 0; i <= r - 1; i++)
    for (ll j = 0; j <= c - 1; j++) cin >> a[i][j];
  for (ll i = 0; i <= r - 1; i++)
    for (ll j = 0; j <= c - 1; j++) cin >> b[i][j];
  for (ll i = 0; i <= r - 1; i++)
    for (ll j = 0; j <= c - 1; j++)
      if (a[i][j] > b[i][j]) swap(a[i][j], b[i][j]);
  bool ans = true;
  for (ll i = 0; i <= r - 1; i++)
    for (ll j = 0; j <= c - 1; j++) {
      if (i > 0 && (a[i][j] <= a[i - 1][j] || b[i][j] <= b[i - 1][j]))
        ans = false;
      if (j > 0 && (a[i][j] <= a[i][j - 1] || b[i][j] <= b[i][j - 1]))
        ans = false;
    }
  if (ans)
    cout << "Possible\n";
  else
    cout << "Impossible\n";
  return 0;
}
