#include <bits/stdc++.h>
using namespace std;
int n, m, a[60][60], b[60][60];
bool dbm() {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m - 1; j++)
      if (!((a[i][j] < a[i][j + 1] && b[i][j] < b[i][j + 1]) ||
            (a[i][j] < b[i][j + 1] && b[i][j] < a[i][j + 1])))
        return false;
  for (int i = 0; i < m; i++)
    for (int j = 0; j < n - 1; j++)
      if (!((a[j][i] < a[j + 1][i] && b[j][i] < b[j + 1][i]) ||
            (a[j][i] < b[j + 1][i] && b[j][i] < a[j + 1][i])))
        return false;
  return true;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) scanf("%d", &a[i][j]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) scanf("%d", &b[i][j]);
  if (dbm())
    printf("Possible\n");
  else
    printf("Impossible\n");
  return 0;
}
