#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long a[60][60], b[60][60];
  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 - 1; i++) {
    for (long long j = 0; j < m; j++) {
      if (a[i][j] >= a[i + 1][j] || b[i][j] >= b[i + 1][j]) {
        cout << "Impossible";
        return 0;
      }
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m - 1; j++) {
      if (a[i][j] >= a[i][j + 1] || b[i][j] >= b[i][j + 1]) {
        cout << "Impossible";
        return 0;
      }
    }
  }
  cout << "Possible";
  return 0;
}
