#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  int a[n][m], b[n][m];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) cin >> a[i][j];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) cin >> b[i][j];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if (a[i][j] > b[i][j]) swap(a[i][j], b[i][j]);
  bool pass = true;
  for (int i = 0; i < n - 1; ++i)
    for (int j = 0; j < m - 1; ++j) {
      if (a[i][j] >= a[i + 1][j] || a[i][j] >= a[i][j + 1] ||
          b[i][j] >= b[i + 1][j] || b[i][j] >= b[i][j + 1])
        pass = false;
    }
  for (int i = 0; i < m - 1; ++i)
    if (a[n - 1][i] >= a[n - 1][i + 1] || b[n - 1][i] >= b[n - 1][i + 1])
      pass = false;
  for (int i = 0; i < n - 1; ++i)
    if (a[i][m - 1] >= a[i + 1][m - 1] || b[i][m - 1] >= b[i + 1][m - 1])
      pass = false;
  pass ? puts("Possible") : puts("Impossible");
}
