#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const long long int mxN = 1e9 + 9;
vector<vector<long long int>> ar(55, vector<long long int>(55, mxN));
vector<vector<long long int>> br(55, vector<long long int>(55, mxN));
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  long long int test, i, j;
  test = 1;
  while (test--) {
    long long int n, m;
    cin >> n >> m;
    for (i = 0; i < n; i++)
      for (j = 0; j < m; j++) cin >> ar[i][j];
    for (i = 0; i < n; i++)
      for (j = 0; j < m; j++) cin >> br[i][j];
    bool fl = 0;
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        if (ar[i][j] > br[i][j]) swap(ar[i][j], br[i][j]);
      }
    }
    for (i = 0; i < n && !fl; i++) {
      for (j = 0; j < m && !fl; j++) {
        if (ar[i][j] >= min(ar[i][j + 1], ar[i + 1][j])) fl = 1;
      }
    }
    for (i = 0; i < n && !fl; i++) {
      for (j = 0; j < m && !fl; j++) {
        if (br[i][j] >= min(br[i][j + 1], br[i + 1][j])) fl = 1;
      }
    }
    if (fl)
      cout << "Impossible\n";
    else
      cout << "Possible\n";
  }
  return 0;
}
