#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<vector<int>> a, b;
bool check(vector<vector<int>>& a) {
  for (int c = 0; c < m; c++) {
    int prev = 0;
    for (int j = 0; j < n; j++) {
      if (a[j][c] <= prev) return 0;
      prev = a[j][c];
    }
  }
  for (int i = 0; i < n; i++) {
    int prev = 0;
    for (int j = 0; j < m; j++) {
      if (a[i][j] <= prev) return 0;
      prev = a[i][j];
    }
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  {
    a.clear();
    a.resize(n, vector<int>(m, 0));
  };
  {
    b.clear();
    b.resize(n, vector<int>(m, 0));
  };
  for (auto& i : a) {
    {
      for (auto& i : i) cin >> i;
    };
  }
  for (auto& i : b) {
    {
      for (auto& i : i) cin >> i;
    };
  }
  for (int r = 0; r < n; r++) {
    for (int c = 0; c < m; c++) {
      if (a[r][c] < b[r][c]) swap(a[r][c], b[r][c]);
    }
  }
  if (check(a) && check(b))
    cout << "Possible";
  else
    cout << "Impossible";
  return 0;
}
