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

x = list([abs(int(y)-X) for y in input().split()])

m = min(x)



def prim(y):

    p=[]

    while y>1:

        for i in range(2,y+1):

            if y%i==0:

                y//=i

                p.append(i)

                break

    return p

   

ans=1



for i in prim(m):

    if m%i !=0:

        continue

    if set([j%i for j in x]) == {0}:

        ans *= i

        x = [j//i for j in x]

    if set([j%(m//i) for j in x]) == {0}:

        ans *= (m//i)

        x = [j//(m//i) for j in x]



print(ans)
import fractions

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

x = list([abs(int(y)-X) for y in input().split()])

m = min(x)



ans = x[0]

for i in range(1,N):

    ans = fractions.gcd(ans,x[i])

    

print(ans)
N, X = list(map(int, input().split()))
x = list([abs(int(y) - X) for y in input().split()])
m = min(x)


def prim(y):
    p = []
    while y > 1:
        for i in range(2, y + 1):
            if y % i == 0:
                y //= i
                p.append(i)
                break
    return p


ans = 1
for i in prim(m):
    if m % i != 0:
        continue
    if set([j % i for j in x]) == {0}:
        ans *= i
        x = [j // i for j in x]
    if set([j % (m // i) for j in x]) == {0}:
        ans *= m // i
        x = [j // (m // i) for j in x]
print(ans)

import fractions

N, X = list(map(int, input().split()))
x = list([abs(int(y) - X) for y in input().split()])
m = min(x)
ans = x[0]
for i in range(1, N):
    ans = fractions.gcd(ans, x[i])
print(ans)

+import fractions + - - -def prim(y): -    p = [] -    while y > 1: -        for i in range(2, y + 1): -            if y % i == 0: -                y //= i -                p.append(i) -                break -    return p - - -ans = 1 -for i in prim(m): -    if m % i != 0: -        continue -    if set([j % i for j in x]) == {0}: -        ans *= i -        x = [j // i for j in x] -    if set([j % (m // i) for j in x]) == {0}: -        ans *= m // i -        x = [j // (m // i) for j in x] +ans = x[0] +for i in range(1, N): +    ans = fractions.gcd(ans, x[i])