#include <bits/stdc++.h>
using namespace std;
int m, n;
int a[55][55] = {0};
int b[55][55] = {0};
int check(int m, int n) {
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n - 1; j++) {
      if (a[i][j] >= a[i][j + 1]) return false;
    }
  }
  for (int j = 1; j <= n; j++) {
    for (int i = 1; i <= m - 1; i++) {
      if (a[i][j] >= a[i + 1][j]) return false;
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n - 1; j++) {
      if (b[i][j] >= b[i][j + 1]) return false;
    }
  }
  for (int j = 1; j <= n; j++) {
    for (int i = 1; i <= m - 1; i++) {
      if (b[i][j] >= b[i + 1][j]) return false;
    }
  }
  return true;
}
int main() {
  cin >> m >> n;
  int x;
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++) cin >> x, a[i][j] = x;
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++)
      cin >> x, b[i][j] = max(x, a[i][j]), a[i][j] = min(x, a[i][j]);
  if (check(m, n)) {
    cout << "Possible";
    return 0;
  }
  cout << "Impossible";
  return 0;
}
