#include <bits/stdc++.h>
using namespace std;
const double PI = 3.1415926535897;
const int N = 26;
int main() {
  int n, m, mat1[107][107], mat2[107][107], matx[107][107], maty[107][107];
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cin >> mat1[i][j];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cin >> mat2[i][j];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      matx[i][j] = min(mat1[i][j], mat2[i][j]);
      maty[i][j] = max(mat1[i][j], mat2[i][j]);
    }
  }
  int flag = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 1; j < m; j++) {
      if (matx[i][j] <= matx[i][j - 1]) {
        flag = 1;
        break;
      }
      if (maty[i][j] <= maty[i][j - 1]) {
        flag = 1;
        break;
      }
    }
  }
  if (flag == 1) {
    cout << "Impossible\n";
    return 0;
  }
  for (int j = 0; j < m; j++) {
    for (int i = 1; i < n; i++) {
      if (matx[i][j] <= matx[i - 1][j]) {
        flag = 1;
        break;
      }
      if (maty[i][j] <= maty[i - 1][j]) {
        flag = 1;
        break;
      }
    }
  }
  if (flag == 1) {
    cout << "Impossible\n";
    return 0;
  }
  cout << "Possible\n";
  return 0;
}
