#include <bits/stdc++.h>
using namespace std;
template <typename T>
using min_queue = priority_queue<T, vector<T>, greater<T>>;
const long long MOD = 1e9 + 7;
int N, M;
vector<vector<int>> a, b;
inline bool inc(const vector<vector<int>>& m) {
  int N = m.size();
  int M = m[0].size();
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      if (j < M - 1 && m[i][j] >= m[i][j + 1]) return 0;
      if (i < N - 1 && m[i][j] >= m[i + 1][j]) return 0;
    }
  }
  return 1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> M;
  a.resize(N);
  b.resize(N);
  for (int i = 0; i < N; i++) {
    a[i].resize(M);
    for (int j = 0; j < M; j++) cin >> a[i][j];
  }
  for (int i = 0; i < N; i++) {
    b[i].resize(M);
    for (int j = 0; j < M; j++) {
      cin >> b[i][j];
      if (b[i][j] < a[i][j]) swap(a[i][j], b[i][j]);
    }
  }
  cout << (inc(a) && inc(b) ? "Possible\n" : "Impossible\n");
  return 0;
}
