#include <bits/stdc++.h>
using namespace std;
int arr[2][51][51];
int sig[2][51][51];
int n, m;
int mini(int a, int b) {
  if (a < b) return a;
  return b;
}
int maxi(int a, int b) {
  if (a > b) return a;
  return b;
}
bool verifica(int z) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if ((sig[z][i][j] <= sig[z][i][j - 1] && j > 0) ||
          ((i > 0 && sig[z][i][j] <= sig[z][i - 1][j])))
        return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> arr[0][i][j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> arr[1][i][j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      sig[0][i][j] = mini(arr[0][i][j], arr[1][i][j]);
      sig[1][i][j] = maxi(arr[0][i][j], arr[1][i][j]);
    }
  if (!verifica(0))
    cout << "Impossible";
  else if (!verifica(1))
    cout << "Impossible";
  else
    cout << "Possible";
  return 0;
}
