The input consists of several test cases terminated by end-of-file. For each test case:
The first line contains two integers n and m -- the size of the matrix.
The second line containsintegers
,
,
,
, where
is the value in the i-th row and the j-th column.
*
*
* It is guaranteed that all cells which contain the same value are 4-side connected.
* It is guaranteed that the sum ofin all test cases does not exceed
.
For each test case, output an integer denoting the value of, where
denotes the exclusive-or (XOR) operator.