#include <bits/stdc++.h>
int main() {
  long long a[55][55], b[55][55];
  int n, m, i, j, s;
  scanf("%d %d", &n, &m);
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) scanf("%lld", &a[i][j]);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) {
      scanf("%lld", &b[i][j]);
      if (a[i][j] > b[i][j]) {
        long long t = a[i][j];
        a[i][j] = b[i][j];
        b[i][j] = t;
      }
    }
  int flag = 1;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; 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]) {
        flag = 0;
        break;
      }
  if (flag)
    printf("Possible\n");
  else
    printf("Impossible\n");
  return 0;
}
