Problem: You are given two matrices containing integers. A sequence of integers is strictly increasing if each next number is greater than the previous one. A row is strictly increasing if all numbers from left to right are strictly increasing. A column is strictly increasing if all numbers from top to bottom are strictly increasing. A matrix is increasing if all rows are strictly increasing and all columns are strictly increasing.
For example, the matrix is increasing because each individual row and column is strictly increasing. On the other hand, the matrix is not increasing because the first row is not strictly increasing.
Let a position in the -th row (from top) and -th column (from left) in a matrix be denoted as .
In one operation, you can choose any two numbers and and swap the number located in in the first matrix with the number in in the second matrix. In other words, you can swap two numbers in different matrices if they are located in the corresponding positions.
You would like to make both matrices increasing by performing some number of operations (possibly none). Determine if it is possible to do this. If it is, print "Possible", otherwise, print "Impossible".
Input Format: The first line contains two integers and () — the dimensions of each matrix.
Each of the next lines contains integers () — the number located in position in the first matrix.
Each of the next lines contains integers () — the number located in position in the second matrix.
Output Format: Print a string "Impossible" or "Possible".
Note: The first example, we can do an operation on the top left and bottom right cells of the matrices. The resulting matrices will be and .
In the second example, we don't need to do any operations.
In the third example, no matter what we swap, we can't fix the first row to be strictly increasing in both matrices.