#include <bits/stdc++.h>
using namespace std;
int A[55][55], B[55][55];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  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]) swap(A[i][j], B[i][j]);
    }
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M - 1; j++) {
      if (A[i][j] >= A[i][j + 1] || B[i][j] >= B[i][j + 1]) {
        cout << "Impossible" << endl;
        return 0;
      }
    }
  }
  for (int i = 0; i < M; i++) {
    for (int j = 0; j < N - 1; j++) {
      if (A[j][i] >= A[j + 1][i] || B[j][i] >= B[j + 1][i]) {
        cout << "Impossible" << endl;
        return 0;
      }
    }
  }
  cout << "Possible" << endl;
  return 0;
}
