#include <bits/stdc++.h>
using namespace std;
int read() {
  int f = 1;
  int res = 0;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -f;
  } while (ch < '0' || ch > '9');
  do {
    res = res * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return f == 1 ? res : -res;
}
void fast_io() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const int N = 110;
const int mod = 1000000007;
const long long INF = 1e18;
int n, m, q;
int A[N][N], B[N][N], C[N];
char str[N];
int head[N], to[N * 4], nxt[N * 4], avail[N * 4], tot;
void addEdge(int u, int v) {
  tot++;
  nxt[tot] = head[u];
  to[tot] = v;
  head[u] = tot;
  avail[tot] = 1;
}
long long mmax(long long a, long long b) { return a > b ? a : b; }
long long mmin(long long a, long long b) { return a < b ? a : b; }
int countOne(int set) {
  int res = 0;
  while (set) {
    res++;
    set &= set - 1;
  }
  return res;
}
bool contain(int set, int i) { return (set & (1 << i)) > 0; }
long long myPow(long long a, int p) {
  if (p == 0) return 1;
  long long res = myPow(a, p / 2);
  res *= res;
  res %= mod;
  if (p % 2 == 1) {
    res *= a;
    res %= mod;
  }
  return res;
}
void mySwap(int &a, int &b) {
  int tmp = a;
  a = b;
  b = tmp;
}
int main() {
  fast_io();
  cin >> 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];
  bool ok = true;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      if (i > 0) {
        if (A[i][j] <= A[i - 1][j]) {
          mySwap(A[i][j], B[i][j]);
          if (A[i][j] <= A[i - 1][j]) ok = false;
          if (B[i][j] <= B[i - 1][j]) ok = false;
        }
        if (B[i][j] <= B[i - 1][j]) {
          mySwap(A[i][j], B[i][j]);
          if (A[i][j] <= A[i - 1][j]) ok = false;
          if (B[i][j] <= B[i - 1][j]) ok = false;
        }
      }
      if (j > 0) {
        if (A[i][j] <= A[i][j - 1]) {
          mySwap(A[i][j], B[i][j]);
          if (A[i][j] <= A[i][j - 1]) ok = false;
          if (B[i][j] <= B[i][j - 1]) ok = false;
        }
        if (B[i][j] <= B[i][j - 1]) {
          mySwap(A[i][j], B[i][j]);
          if (A[i][j] <= A[i][j - 1]) ok = false;
          if (B[i][j] <= B[i][j - 1]) ok = false;
        }
      }
    }
  if (ok) {
    cout << "Possible" << endl;
  } else {
    cout << "Impossible" << endl;
  }
  return 0;
}
