Game of Thrones#11542

Game of Thrones

2 seconds
128 megabytes
Medium

Be careful here is spoiler

George Martin writes last volume of A Song of Ice and Fire. In this volume Daenerys Targaryen will take Iron throne. But firstly she needs to find the maximum protection value of Seven kingdoms for the first attack. Tyrion Lannister as military adviser needs to help her. You can assume that Seven kingdoms is a rectangle and each cell has its own protection value. Protection value of an area is the xor of all cells in it. Tyrion needs to choose some rectangle with maximum protection value. The sides of rectangle must be parallel to the sides of 7 kingdoms. Help him to find such area.

Input

The first line contains two integers — n, m~(1 \le n, m \le 300), the height and the width of a Kingdom.

Each of the next lines contains integers a_{i,j}~(0 \le a_{i,j} < 2^{16}), protection value of the cell .

Output

Print one integer — the answer to the problem.

Examples

Example 1

Loading
Loading