#include <bits/stdc++.h>
using namespace std;
int modInverse(int a, int m);
int gcd(int a, int b);
int power(int x, unsigned int y, unsigned int m);
void pairsort(int a[], int b[], int n);
int logint(int x, int y);
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int power(int x, unsigned int y, unsigned int m) {
  if (y == 0) return 1;
  int p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
int modInverse(int a, int m) {
  int m0 = m;
  int y = 0, x = 1;
  if (m == 1) return 0;
  while (a > 1) {
    int q = a / m;
    int t = m;
    m = a % m, a = t;
    t = y;
    y = x - q * y;
    x = t;
  }
  if (x < 0) x += m0;
  return x;
}
void pairsort(int a[], int b[], int n) {
  pair<int, int> pairt[n];
  for (int i = 0; i < n; i++) {
    pairt[i].first = a[i];
    pairt[i].second = b[i];
  }
  sort(pairt, pairt + n);
  for (int i = 0; i < n; i++) {
    a[i] = pairt[i].first;
    b[i] = pairt[i].second;
  }
}
int logint(int x, int y) {
  int ans = 0;
  int a = 1;
  for (int i = 0; i < x; i++) {
    if (x <= a) {
      return ans;
    }
    ans++;
    a *= y;
  }
  return -1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  int a[2][n][m];
  for (int k = 0; k < 2; k++) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        int t;
        cin >> t;
        a[k][i][j] = t;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (a[0][i][j] > a[1][i][j]) {
        int t = a[0][i][j];
        a[0][i][j] = a[1][i][j];
        a[1][i][j] = t;
      }
    }
  }
  int flag = 0;
  for (int k = 0; k < 2; k++) {
    for (int i = 0; i < n; i++) {
      int cur = a[k][i][0];
      for (int j = 1; j < m; j++) {
        if (a[k][i][j] <= cur) {
          flag = 1;
        } else {
          cur = a[k][i][j];
        }
      }
    }
    for (int i = 0; i < m; i++) {
      int cur = a[k][0][i];
      for (int j = 1; j < n; j++) {
        if (a[k][j][i] <= cur) {
          flag = 1;
        } else {
          cur = a[k][j][i];
        }
      }
    }
  }
  if (flag == 1) {
    cout << "Impossible";
  } else {
    cout << "Possible";
  }
  return 0;
}
