#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m, flag = 0;
  cin >> n >> m;
  long long int a[n][m], b[n][m];
  for (long long int(i) = 0; (i) < (n); ++(i)) {
    for (long long int(j) = 0; (j) < (m); ++(j)) {
      cin >> a[i][j];
    }
  }
  for (long long int(i) = 0; (i) < (n); ++(i)) {
    for (long long int(j) = 0; (j) < (m); ++(j)) {
      cin >> b[i][j];
    }
  }
  for (long long int(i) = 0; (i) < (n); ++(i)) {
    for (long long int(j) = 0; (j) < (m); ++(j)) {
      if (a[i][j] > b[i][j]) swap(a[i][j], b[i][j]);
    }
  }
  for (long long int(i) = 0; (i) < (n); ++(i)) {
    for (long long int(j) = 0; (j) < (m - 1); ++(j)) {
      if (a[i][j] >= a[i][j + 1]) {
        flag = 1;
      }
    }
  }
  for (long long int(j) = 0; (j) < (m); ++(j)) {
    for (long long int(i) = 0; (i) < (n - 1); ++(i)) {
      if (a[i][j] >= a[i + 1][j]) {
        flag = 1;
      }
    }
  }
  for (long long int(i) = 0; (i) < (n); ++(i)) {
    for (long long int(j) = 0; (j) < (m - 1); ++(j)) {
      if (b[i][j] >= b[i][j + 1]) {
        flag = 1;
      }
    }
  }
  for (long long int(j) = 0; (j) < (m); ++(j)) {
    for (long long int(i) = 0; (i) < (n - 1); ++(i)) {
      if (b[i][j] >= b[i + 1][j]) {
        flag = 1;
      }
    }
  }
  if (flag == 0)
    cout << "Possible";
  else
    cout << "Impossible";
  return 0;
}
