#include <bits/stdc++.h>
long long int arr2[55][55];
int main() {
  long long int a, b, c, d, i, j, p = 0, q = 1, r = 0, s, arr1[55][55], l, h, x,
                                  n, m, k;
  scanf("%lld %lld", &n, &m);
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      scanf("%lld", &arr1[i][j]);
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      scanf("%lld", &arr2[i][j]);
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (arr1[i][j] > arr2[i][j]) {
        q = arr1[i][j];
        arr1[i][j] = arr2[i][j];
        arr2[i][j] = q;
      }
    }
  }
  p = 0;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m - 1; j++) {
      if (arr1[i][j] >= arr1[i][j + 1] || arr2[i][j] >= arr2[i][j + 1]) p = 1;
    }
  }
  for (i = 1; i <= n - 1; i++) {
    for (j = 1; j <= m; j++) {
      if (arr1[i][j] >= arr1[i + 1][j] || arr2[i][j] >= arr2[i + 1][j]) p = 1;
    }
  }
  if (p == 1)
    printf("Impossible\n");
  else
    printf("Possible\n");
  return 0;
}
