#include <bits/stdc++.h>
using namespace std;
int n, m, a[55][55], b[55][55];
int main() {
  int f = 1;
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> b[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (a[i][j] > b[i][j]) swap(b[i][j], a[i][j]);
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (a[i][j - 1] < a[i][j] && b[i][j - 1] < b[i][j])
        continue;
      else {
        f = 0;
        break;
      }
      if (f == 0) break;
    }
  }
  if (f) {
    for (int j = 1; j <= m; j++) {
      for (int i = 2; i <= n; i++) {
        if (a[i - 1][j] < a[i][j] && b[i - 1][j] < b[i][j])
          continue;
        else {
          f = 0;
          break;
        }
        if (f == 0) break;
      }
    }
  }
  if (f)
    cout << "Possible";
  else
    cout << "Impossible";
  return 0;
}
