#include <bits/stdc++.h>
using namespace std;
clock_t __START, __END;
double __TOTALTIME;
void _MS() { __START = clock(); }
void _ME() {
  __END = clock();
  __TOTALTIME = (double)(__END - __START) / CLOCKS_PER_SEC;
  cout << "Time: " << __TOTALTIME << " s" << endl;
}
const double E = 2.718281828;
const double PI = acos(-1.0);
const long long INF = (1LL << 60);
const int inf = (1 << 30);
const double ESP = 1e-8;
const int mod = (int)1e9 + 7;
const int N = (int)1e6 + 10;
int a[100][100], b[100][100];
signed main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) scanf("%d", &a[i][j]);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) scanf("%d", &b[i][j]);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      if (a[i][j] > b[i][j]) swap(a[i][j], b[i][j]);
  int ok = 1;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      if (i > 1 && (a[i - 1][j] >= a[i][j] || b[i - 1][j] >= b[i][j])) ok = 0;
      if (j > 1 && (a[i][j - 1] >= a[i][j] || b[i][j - 1] >= b[i][j])) ok = 0;
    }
  if (ok)
    printf("Possible\n");
  else
    printf("Impossible\n");
  return 0;
}
