#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = 0x3f3f3f3f;
const int maxn = 55;
int a[maxn][maxn], b[maxn][maxn];
int n, m;
bool ok(int x, int y) {
  if (x > 1 && a[x][y] <= a[x - 1][y]) return false;
  if (y > 1 && a[x][y] <= a[x][y - 1]) return false;
  if (x > 1 && b[x][y] <= b[x - 1][y]) return false;
  if (y > 1 && b[x][y] <= b[x][y - 1]) return false;
  return true;
}
bool judge() {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (!ok(i, j)) return false;
    }
  }
  return true;
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> a[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      cin >> b[i][j];
      if (a[i][j] > b[i][j]) swap(a[i][j], b[i][j]);
    }
  if (judge())
    cout << "Possible";
  else
    cout << "Impossible";
  return 0;
}
