#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[52][52], b[52][52];
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> 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 tmp = a[i][j];
        a[i][j] = b[i][j];
        b[i][j] = tmp;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 1; j < m; j++) {
      if (a[i][j] <= a[i][j - 1] || b[i][j] <= b[i][j - 1]) {
        cout << "Impossible\n";
        return 0;
      }
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 1; j < n; j++) {
      if (a[j][i] <= a[j - 1][i] || b[j][i] <= b[j - 1][i]) {
        cout << "Impossible\n";
        return 0;
      }
    }
  }
  cout << "Possible\n";
}
