When performing integer division of a dividend by a divisor , we obtain a quotient and a remainder . The quotient is the largest integer for which the inequality q \cdot d \le n holds, and the remainder is given by r = n - q \cdot d.
It is known that for any set of integers, there exists an integer such that dividing each of these numbers by yields the same remainder.
Each line contains a sequence of -bit integers. The last number in each line is and does not belong to the sequence. Each sequence contains at least and at most numbers. It is guaranteed that not all numbers in a sequence are equal. The last line contains a single and should not be processed.
For each line, print the largest integer such that dividing each number in the given sequence by yields the same remainder.
Example 1