#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  int doubleMatrix(int n, int m, vector<vector<int>>& a,
                   vector<vector<int>>& b) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) {
        if (b[i][j] < a[i][j]) swap(a[i][j], b[i][j]);
      }
    }
    for (int i = 0; i < n; ++i) {
      for (int j = 1; j < m; ++j) {
        if (a[i][j - 1] >= a[i][j] || b[i][j - 1] >= b[i][j]) return false;
      }
    }
    for (int i = 1; i < n; ++i) {
      for (int j = 0; j < m; ++j) {
        if (a[i - 1][j] >= a[i][j] || b[i - 1][j] >= b[i][j]) return false;
      }
    }
    return true;
  }
};
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> a(n, vector<int>(m));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> a[i][j];
    }
  }
  vector<vector<int>> b(n, vector<int>(m));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> b[i][j];
    }
  }
  bool result = Solution().doubleMatrix(n, m, a, b);
  cout << (result ? "Possible" : "Impossible") << endl;
  return 0;
}
