#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, m, mat1[51][51], mat2[51][51];
void check(bool& ans, int mat[][51]) {
  for (int i = 0; i < n; ++i)
    for (int j = 1; j < m; ++j)
      if (mat[i][j] <= mat[i][j - 1]) {
        ans = false;
        return;
      }
  for (int j = 0; j < m; ++j)
    for (int i = 1; i < n; ++i)
      if (mat[i][j] <= mat[i - 1][j]) {
        ans = false;
        return;
      }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) cin >> mat1[i][j];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) cin >> mat2[i][j];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if (mat1[i][j] > mat2[i][j]) swap(mat1[i][j], mat2[i][j]);
  bool ans = true;
  check(ans, mat1);
  check(ans, mat2);
  cout << (ans ? "Possible" : "Impossible") << endl;
}
