#include <bits/stdc++.h>
using namespace std;
int a[60][60], b[60][60];
int n, m;
int main() {
  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++) {
      int minn = min(a[i][j], b[i][j]);
      int maxn = max(a[i][j], b[i][j]);
      a[i][j] = minn;
      b[i][j] = maxn;
    }
  int flag = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (a[i][j] <= a[i - 1][j] || a[i][j] <= a[i][j - 1] ||
          b[i][j] <= b[i - 1][j] || b[i][j] <= b[i][j - 1]) {
        flag = 1;
        break;
      }
  if (flag == 0)
    printf("Possible\n");
  else
    printf("Impossible\n");
  return 0;
}
