#include <bits/stdc++.h>
using namespace std;
int a[55][55];
int b[55][55];
int 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 flag = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (j != m)
        if (a[i][j] >= a[i][j + 1]) {
          flag = 1;
          break;
        }
      if (i != n)
        if (a[i][j] >= a[i + 1][j]) {
          flag = 1;
          break;
        }
    }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (j != m)
        if (b[i][j] >= b[i][j + 1]) {
          flag = 1;
          break;
        }
      if (i != n)
        if (b[i][j] >= b[i + 1][j]) {
          flag = 1;
          break;
        }
    }
  puts(flag ? "Impossible" : "Possible");
  return 0;
}
