#include <bits/stdc++.h>
int n, m;
int m1[60][60], m2[60][60];
int main() {
  int i, j;
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) scanf("%d", &m1[i][j]);
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) scanf("%d", &m2[i][j]);
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++)
      if (m1[i][j] > m2[i][j]) {
        int t1 = m1[i][j];
        m1[i][j] = m2[i][j];
        m2[i][j] = t1;
      }
  int fl = 1;
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) {
      if (i != 0 && (m1[i][j] <= m1[i - 1][j] || m2[i][j] <= m2[i - 1][j]))
        fl = 0;
      if (j != 0 && (m1[i][j] <= m1[i][j - 1] || m2[i][j] <= m2[i][j - 1]))
        fl = 0;
    }
  if (fl)
    printf("Possible\n");
  else
    printf("Impossible\n");
  return 0;
}
