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