from functools import reduce



def gcd(a, b):

    if a < b:

        a, b = b, a

    if b == 0:

        return a

    c = a % b

    return gcd(b, c)



def gcd_list(nums):

    return reduce(gcd, nums)



N, X = list(map(int, input().split()))

x = list(map(int, input().split()))



x_sorted = x

x_sorted.append(X)

x_sorted.sort()



diff = []

for i, xi in enumerate(x_sorted):

    if i == 0:

        continue

    else:

        diff.append(xi - x_sorted[i-1])



print((gcd_list(diff)))





from functools import reduce

from fractions import gcd



def gcd(a, b):

    while b:

        a, b = b, a%b

    return a



def gcd_list(nums):

    return reduce(gcd, nums)



N, X = list(map(int, input().split()))

x = list(map(int, input().split()))

diff = [abs(xi - X) for xi in x]

print((gcd_list(diff)))

from functools import reduce


def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)


def gcd_list(nums):
    return reduce(gcd, nums)


N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
x_sorted = x
x_sorted.append(X)
x_sorted.sort()
diff = []
for i, xi in enumerate(x_sorted):
    if i == 0:
        continue
    else:
        diff.append(xi - x_sorted[i - 1])
print((gcd_list(diff)))

from functools import reduce
from fractions import gcd


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def gcd_list(nums):
    return reduce(gcd, nums)


N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
diff = [abs(xi - X) for xi in x]
print((gcd_list(diff)))

+from fractions import gcd -    if a < b: -        a, b = b, a -    if b == 0: -        return a -    c = a % b -    return gcd(b, c) +    while b: +        a, b = b, a % b +    return a -x_sorted = x -x_sorted.append(X) -x_sorted.sort() -diff = [] -for i, xi in enumerate(x_sorted): -    if i == 0: -        continue -    else: -        diff.append(xi - x_sorted[i - 1]) +diff = [abs(xi - X) for xi in x]