#include <bits/stdc++.h>
using namespace std;
const int N = 55, mod = (int)1e9 + 7;
int a1[N][N], a2[N][N] = {};
int main() {
  ios::sync_with_stdio(0), ios_base::sync_with_stdio(0), cin.tie(0),
      cout.tie(0);
  ;
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= (int)n; ++i) {
    for (int j = 1; j <= (int)m; ++j) {
      cin >> a1[i][j];
    }
  }
  for (int i = 1; i <= (int)n; ++i) {
    for (int j = 1; j <= (int)m; ++j) {
      cin >> a2[i][j];
      if (a1[i][j] > a2[i][j]) swap(a1[i][j], a2[i][j]);
    }
  }
  for (int i = 1; i <= (int)n; ++i) {
    for (int j = 1; j <= (int)m; ++j) {
      if (i + 1 <= n && a1[i][j] >= a1[i + 1][j]) {
        return cout << "Impossible"
                    << "\n",
               0;
      }
      if (j + 1 <= m && a1[i][j] >= a1[i][j + 1]) {
        return cout << "Impossible"
                    << "\n",
               0;
      }
      if (i + 1 <= n && a2[i][j] >= a2[i + 1][j]) {
        return cout << "Impossible"
                    << "\n",
               0;
      }
      if (j + 1 <= m && a2[i][j] >= a2[i][j + 1]) {
        return cout << "Impossible"
                    << "\n",
               0;
      }
    }
  }
  return cout << "Possible"
              << "\n",
         0;
  return 0;
}
