#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int> > m1(n, vector<int>(m, 0));
  vector<vector<int> > m2(n, vector<int>(m, 0));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> m1[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> m2[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (m1[i][j] > m2[i][j]) swap(m1[i][j], m2[i][j]);
    }
  }
  bool flag = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m - 1; j++) {
      if (m1[i][j] >= m1[i][j + 1] || m2[i][j] >= m2[i][j + 1]) flag = 0;
    }
  }
  for (int i = 0; i < n - 1; i++) {
    for (int j = 0; j < m; j++) {
      if (m1[i][j] >= m1[i + 1][j] || m2[i][j] >= m2[i + 1][j]) flag = 0;
    }
  }
  if (flag)
    cout << "Possible\n";
  else
    cout << "Impossible\n";
  return 0;
}
