from functools import reduce

from fractions import gcd





def gcd_arg(lst):

    return reduce(gcd, lst)





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

lst_x = list(map(int, input().split())) + [X]

lst_x.sort()

lst_diff = [lst_x[i] - lst_x[i-1] for i in range(1, N+1)]

ans = gcd_arg(lst_diff)

print(ans)

from fractions import gcd





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

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





ans = abs(X - lst_x[0])

for x in lst_x[1::]:

    ans = gcd(ans, abs(X - x))

print(ans)

from functools import reduce
from fractions import gcd


def gcd_arg(lst):
    return reduce(gcd, lst)


N, X = list(map(int, input().split()))
lst_x = list(map(int, input().split())) + [X]
lst_x.sort()
lst_diff = [lst_x[i] - lst_x[i - 1] for i in range(1, N + 1)]
ans = gcd_arg(lst_diff)
print(ans)

from fractions import gcd

N, X = list(map(int, input().split()))
lst_x = list(map(int, input().split()))
ans = abs(X - lst_x[0])
for x in lst_x[1::]:
    ans = gcd(ans, abs(X - x))
print(ans)

-from functools import reduce - -def gcd_arg(lst): -    return reduce(gcd, lst) - - -lst_x = list(map(int, input().split())) + [X] -lst_x.sort() -lst_diff = [lst_x[i] - lst_x[i - 1] for i in range(1, N + 1)] -ans = gcd_arg(lst_diff) +lst_x = list(map(int, input().split())) +ans = abs(X - lst_x[0]) +for x in lst_x[1::]: +    ans = gcd(ans, abs(X - x))