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