SOLVE
LATER
Monk has a matrix of size \(N \times M\), and he wants to pick one element from each row to make a new array A of size N. He wants to find the minimum possible value of absolute difference between any two adjacent elements in the array A. Please note that the element picked from row 1, will become \(A[1]\), element picked from row 2 will become \(A[2]\), and so on.
Input:
First line consists of two space separated integers denoting N and M.
Each of the following N lines consists of M space separated integers denoting the matrix \(mat\).
Output:
Print the required answer in a new line.
Constraints:
\(2 \le N, M \le 1000\)
\(1 \le mat[i][j] \le 10^9\)
Minimum difference Monk can achieve is 0 by choosing 8 from both rows.