#include <bits/stdc++.h>
const double eps = (1e-9);
using namespace std;
int dcmp(long double a, long double b) {
  return fabsl(a - b) <= eps ? 0 : (a > b) ? 1 : -1;
}
int getBit(int num, int idx) { return ((num >> idx) & 1) == 1; }
int setBit1(int num, int idx) { return num | (1 << idx); }
long long setBit0(long long num, int idx) { return num & ~(1ll << idx); }
long long flipBit(int num, int idx) { return num ^ (1 << idx); }
void FS() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const int N = 60;
int a[N][N], b[N][N], n, m;
bool check() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m - 1; j++) {
      if (a[i][j] >= a[i][j + 1]) return 0;
      if (b[i][j] >= b[i][j + 1]) return 0;
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n - 1; j++) {
      if (a[j][i] >= a[j + 1][i]) return 0;
      if (b[j][i] >= b[j + 1][i]) return 0;
    }
  }
  return 1;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> b[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (a[i][j] > b[i][j]) {
        swap(a[i][j], b[i][j]);
      }
    }
  }
  bool ret = check();
  if (ret)
    cout << "Possible\n";
  else
    cout << "Impossible\n";
}
