#include <bits/stdc++.h>
using namespace std;
const int N = 55, MOD = 7 + 1e9;
int a[N][N], b[N][N], tmp[N][N];
bool check(int n, int m) {
  for (int i = 1; i <= n; i++) {
    for (int j = 2; j <= m; j++) {
      if (tmp[i][j] <= tmp[i][j - 1]) return false;
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 2; j <= n; j++) {
      if (tmp[j][i] <= tmp[j - 1][i]) return false;
    }
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  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];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) tmp[i][j] = min(a[i][j], b[i][j]);
  if (check(n, m)) {
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++) tmp[i][j] = max(a[i][j], b[i][j]);
    if (check(n, m)) {
      puts("Possible");
      return 0;
    }
  }
  puts("Impossible");
  return 0;
}
