#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, m, n, f, t;
  f = 0;
  string s;
  s = "Possible";
  cin >> m >> n;
  int a[m][n], b[m][n];
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) cin >> a[i][j];
  }
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      cin >> b[i][j];
      if (b[i][j] < a[i][j]) {
        t = a[i][j];
        a[i][j] = b[i][j];
        b[i][j] = t;
      }
    }
  }
  for (i = 0; i < m; i++) {
    for (j = 0; j < (n - 1); j++) {
      if (a[i][j] >= a[i][j + 1] || b[i][j] >= b[i][j + 1]) {
        f = 1;
        break;
      }
    }
    if (f == 1) break;
  }
  if (f == 0) {
    for (i = 0; i < n; i++) {
      for (j = 0; j < (m - 1); j++) {
        if (a[j][i] >= a[j + 1][i] || b[j][i] >= b[j + 1][i]) {
          f = 1;
          break;
        }
      }
      if (f == 1) break;
    }
  }
  if (f == 1) s = "Impossible";
  cout << s;
  return 0;
}
