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