# coding: utf-8



def gcd(x, y):

    if y == 0:

        return x

    else:

        return gcd(y, x%y)





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



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

x.append(X)

x = sorted(x)



A = [ abs(x[i+1] - x[i]) for i in range(N)]





for i in range(len(A)):

    if i == 0:

        ans = A[i]

    else:

        ans = gcd(ans, A[i])



print(ans)
def gcd(x, y):

    while y != 0:

        x, y = y, x % y

    return x





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

x = [int(a) for a in input().split()]



ans = 0

for xx in x:

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



print(ans)
# coding: utf-8
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)


N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
x.append(X)
x = sorted(x)
A = [abs(x[i + 1] - x[i]) for i in range(N)]
for i in range(len(A)):
    if i == 0:
        ans = A[i]
    else:
        ans = gcd(ans, A[i])
print(ans)

def gcd(x, y):
    while y != 0:
        x, y = y, x % y
    return x


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

-# coding: utf-8 -    if y == 0: -        return x -    else: -        return gcd(y, x % y) +    while y != 0: +        x, y = y, x % y +    return x -x = list(map(int, input().split())) -x.append(X) -x = sorted(x) -A = [abs(x[i + 1] - x[i]) for i in range(N)] -for i in range(len(A)): -    if i == 0: -        ans = A[i] -    else: -        ans = gcd(ans, A[i]) +x = [int(a) for a in input().split()] +ans = 0 +for xx in x: +    ans = gcd(ans, abs(X - xx))