#include <bits/stdc++.h>
using namespace std;
int const N_max = 51;
int T[N_max][N_max];
int T1[N_max][N_max];
int T_max[N_max][N_max];
int T_min[N_max][N_max];
int increasing_mat(int n, int m) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m - 1; j++)
      if (T[i][j + 1] <= T[i][j]) return 0;
  for (int j = 0; j < m; j++)
    for (int i = 0; i < n - 1; i++)
      if (T[i + 1][j] <= T[i][j]) return 0;
  return 1;
}
int increasing_mat1(int n, int m) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m - 1; j++)
      if (T1[i][j + 1] <= T1[i][j]) return 0;
  for (int j = 0; j < m; j++)
    for (int i = 0; i < n - 1; i++)
      if (T1[i + 1][j] <= T1[i][j]) return 0;
  return 1;
}
int increasing_mat_max(int n, int m) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m - 1; j++)
      if (T_max[i][j + 1] <= T_max[i][j]) return 0;
  for (int j = 0; j < m; j++)
    for (int i = 0; i < n - 1; i++)
      if (T_max[i + 1][j] <= T_max[i][j]) return 0;
  return 1;
}
int increasing_mat_min(int n, int m) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m - 1; j++)
      if (T_min[i][j + 1] <= T_min[i][j]) return 0;
  for (int j = 0; j < m; j++)
    for (int i = 0; i < n - 1; i++)
      if (T_min[i + 1][j] <= T_min[i][j]) return 0;
  return 1;
}
int main() {
  int n, m, a;
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> T[i][j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> T1[i][j];
  if ((increasing_mat(n, m) == 1) && (increasing_mat1(n, m) == 1)) {
    cout << "Possible" << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      T_max[i][j] = max(T[i][j], T1[i][j]);
      T_min[i][j] = min(T[i][j], T1[i][j]);
    }
  }
  if ((increasing_mat_max(n, m) == 1) && (increasing_mat_min(n, m) == 1)) {
    cout << "Possible" << endl;
    return 0;
  } else
    cout << "Impossible" << endl;
  return 0;
}
