#include <bits/stdc++.h>
int i, j, k, m, n, t, a[50][50], b[50][50];
int main() {
  for (scanf("%d%d", &n, &m); i < n; i++)
    for (j = 0; j < m; j++) scanf("%d", &a[i][j]);
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++)
      scanf("%d", &b[i][j]),
          b[i][j] > a[i][j] ?: (k = a[i][j], a[i][j] = b[i][j], b[i][j] = k);
  for (i = 0; i < n; i++)
    for (j = 1; j < m; j++)
      t += (a[i][j] <= a[i][j - 1]) + (b[i][j] <= b[i][j - 1]);
  for (j = 0; j < m; j++)
    for (i = 1; i < n; i++)
      t += (a[i][j] <= a[i - 1][j]) + (b[i][j] <= b[i - 1][j]);
  puts(t ? "Impossible" : "Possible");
}
