#include <bits/stdc++.h>
using namespace std;
int dx[10] = {1, -1, 0, 0};
int dy[10] = {0, 0, 1, -1};
const long long mod = 1e9 + 7;
long long cur;
long long tich = 1;
vector<int> G[300005];
int n, h, m;
int a[105][105];
int b[105][105];
int ans;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> a[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      cin >> b[i][j];
      if (b[i][j] < a[i][j]) {
        int tmp = b[i][j];
        b[i][j] = a[i][j];
        a[i][j] = tmp;
      }
    }
  for (int i = 1; i < n; i++)
    for (int j = 1; j <= m; j++) {
      if (a[i][j] >= a[i + 1][j]) {
        cout << "Impossible";
        return 0;
      }
      if (b[i][j] >= b[i + 1][j]) {
        cout << "Impossible";
        return 0;
      }
    }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j < m; j++) {
      if (a[i][j] >= a[i][j + 1]) {
        cout << "Impossible";
        return 0;
      }
      if (b[i][j] >= b[i][j + 1]) {
        cout << "Impossible";
        return 0;
      }
    }
  cout << "Possible";
}
