#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const int mod = 1e9 + 7;
long long a[52][52], b[52][52];
int32_t main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < 52; i++) {
    for (long long j = 0; j < 52; j++) a[i][j] = b[i][j] = INT_MAX;
  }
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) cin >> a[i][j];
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) cin >> b[i][j];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      long long x = a[i][j];
      long long y = b[i][j];
      a[i][j] = min(x, y);
      b[i][j] = max(x, y);
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (a[i][j] >= a[i][j + 1] || a[i][j] >= a[i + 1][j] ||
          b[i][j] >= b[i][j + 1] || b[i][j] >= b[i + 1][j]) {
        cout << "Impossible";
        return 0;
      }
    }
  }
  cout << "Possible";
  return 0;
}
