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