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