#include <bits/stdc++.h>
using namespace std;
const int MAX = 100;
const int inf = 1e9 + 10;
int a[MAX][MAX];
int b[MAX][MAX];
int n, m;
bool check(int i, int j) {
  if (i > 1) {
    if (!(a[i][j] > a[i - 1][j] && b[i][j] > b[i - 1][j])) {
      swap(a[i][j], b[i][j]);
      if (!(a[i][j] > a[i - 1][j] && b[i][j] > b[i - 1][j])) return false;
    }
  }
  if (j > 1) {
    if (!(a[i][j] > a[i][j - 1] && b[i][j] > b[i][j - 1])) {
      swap(a[i][j], b[i][j]);
      if (!(a[i][j] > a[i][j - 1] && b[i][j] > b[i][j - 1])) return false;
    }
  }
  if (i < n) {
    if (!(a[i][j] < a[i + 1][j] && b[i][j] < b[i + 1][j])) {
      swap(a[i][j], b[i][j]);
      if (!(a[i][j] < a[i + 1][j] && b[i][j] < b[i + 1][j])) return false;
    }
  }
  if (j < m) {
    if (!(a[i][j] < a[i][j + 1] && b[i][j] < b[i][j + 1])) {
      swap(a[i][j], b[i][j]);
      if (!(a[i][j] < a[i][j + 1] && b[i][j] < b[i][j + 1])) return false;
    }
    int n, m;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < MAX; i++)
    for (int j = 0; j < MAX; j++) a[i][j] = b[i][j] = inf;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> b[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (!check(i, j)) {
        return cout << "Impossible\n", 0;
      }
    }
  }
  cout << "Possible\n";
  return 0;
}
