from functools import reduce

from fractions import gcd



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

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

x.append(X)

town = sorted(x)



print((reduce(gcd, [town[i+1] - town[i] for i in range(len(town)-1)])))

import sys

stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

from functools import reduce



i_i = lambda: int(i_s())

i_l = lambda: list(map(int, stdin.readline().split()))

i_s = lambda: stdin.readline().rstrip()



def gcd(a,b):

    while b:

        a, b = b, a%b

    return a



def gcd_list(l):

    return reduce(gcd, l)



N, X = i_l()

x = i_l()



arr = []

for i in range(N-1):

    arr.append(abs(x[i]-x[i+1]))



x = gcd_list(arr + [abs(x-X) for x in x])



print(x)
from functools import reduce
from fractions import gcd

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
x.append(X)
town = sorted(x)
print((reduce(gcd, [town[i + 1] - town[i] for i in range(len(town) - 1)])))

import sys

stdin = sys.stdin
sys.setrecursionlimit(10**7)
from functools import reduce

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()


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


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


N, X = i_l()
x = i_l()
arr = []
for i in range(N - 1):
    arr.append(abs(x[i] - x[i + 1]))
x = gcd_list(arr + [abs(x - X) for x in x])
print(x)

+import sys + +stdin = sys.stdin +sys.setrecursionlimit(10**7) -from fractions import gcd -N, X = list(map(int, input().split())) -x = list(map(int, input().split())) -x.append(X) -town = sorted(x) -print((reduce(gcd, [town[i + 1] - town[i] for i in range(len(town) - 1)]))) +i_i = lambda: int(i_s()) +i_l = lambda: list(map(int, stdin.readline().split())) +i_s = lambda: stdin.readline().rstrip() + + +def gcd(a, b): +    while b: +        a, b = b, a % b +    return a + + +def gcd_list(l): +    return reduce(gcd, l) + + +N, X = i_l() +x = i_l() +arr = [] +for i in range(N - 1): +    arr.append(abs(x[i] - x[i + 1])) +x = gcd_list(arr + [abs(x - X) for x in x]) +print(x)