Simple division#1182

Simple division

1 second
128 megabytes
Medium

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.

Input

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.

Output

For each line, print the largest integer such that dividing each number in the given sequence by yields the same remainder.

Examples

Example 1

Loading
Loading