#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  for (typename vector<T>::const_iterator vi = v.begin(); vi != v.end(); ++vi) {
    if (vi != v.begin()) os << ", ";
    os << *vi;
  }
  os << "}";
  return os;
}
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p) {
  os << '(' << p.first << ", " << p.second << ')';
  return os;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long T, N, M, K;
int m[55][55];
int m2[55][55];
void troca() {
  for (int i = (int)(0); (i) < int(N); (i)++) {
    for (int j = (int)(0); (j) < int(M); (j)++) {
      int a = m[i][j];
      int b = m2[i][j];
      m[i][j] = min(a, b);
      m2[i][j] = max(a, b);
    }
  }
}
bool Hor() {
  for (int i = (int)(0); (i) < int(N); (i)++) {
    for (int j = (int)(1); (j) < int(M); (j)++) {
      if (m[i][j] <= m[i][j - 1]) return false;
    }
  }
  return true;
}
bool Ver() {
  for (int i = (int)(0); (i) < int(M); (i)++) {
    for (int j = (int)(1); (j) < int(N); (j)++) {
      if (m[j][i] <= m[j - 1][i]) return false;
    }
  }
  return true;
}
bool Hor2() {
  for (int i = (int)(0); (i) < int(N); (i)++) {
    for (int j = (int)(1); (j) < int(M); (j)++) {
      if (m2[i][j] <= m2[i][j - 1]) return false;
    }
  }
  return true;
}
bool Ver2() {
  for (int i = (int)(0); (i) < int(M); (i)++) {
    for (int j = (int)(1); (j) < int(N); (j)++) {
      if (m2[j][i] <= m2[j - 1][i]) return false;
    }
  }
  return true;
}
bool solve() {
  troca();
  if (Hor() && Hor2() && Ver() && Ver2())
    return true;
  else
    return false;
}
int main() {
  cin >> N >> M;
  for (int i = (int)(0); (i) < int(N); (i)++) {
    for (int j = (int)(0); (j) < int(M); (j)++) {
      cin >> m[i][j];
    }
  }
  for (int i = (int)(0); (i) < int(N); (i)++) {
    for (int j = (int)(0); (j) < int(M); (j)++) {
      cin >> m2[i][j];
    }
  }
  if (solve())
    cout << "Possible\n";
  else
    cout << "Impossible\n";
  return 0;
}
