In American checkers, when a piece reaches the last row, it becomes a king. A king can move diagonally in any direction, but only one square at a time (as illustrated by the arrows in the diagram).
Consider a board of size M \times N, with a king positioned on a certain square, and no other pieces present (hence, the king cannot capture anything).
Your task is to write a program that calculates the minimum number of moves required for the king to reach a specified target square.
The first line contains two natural numbers and , representing the number of vertical and horizontal lines on the board, respectively (1 \leq M, N \leq 10^9).
The second line contains two natural numbers x_0 and y_0, which are the coordinates (vertical and horizontal line numbers, respectively) of the starting square (1 \leq x_0 \leq M, 1 \leq y_0 \leq N).
The third line provides the coordinates of the target square x_K and y_K in the same format.
Output a single non-negative integer, representing the minimum number of moves required for the king to travel from the starting square to the target square. If the king cannot reach the target square, output -1.
Example 1