c, d = (int(i) for i in input().split())  

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

b = a.copy()

 

k = 0

for i in a:

    b[k] = abs(i - d)

    k += 1

 

m = min(b) 

 

def dec():

 

    i = m

    while i > 0:

        if m% i == 0: 

            k = 0

            for j in b:

                if j%i ==0:

                    k +=1

                if k==len(b):

                    return i

                

            if i == m:

                i -= i//2

                

        i -=1

 

 

 

 

                

print((dec()))
import fractions

 

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

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

D = abs(x[0]-X)

for i in x:

    D = fractions.gcd(D,abs(i-X))

print(D)
c, d = (int(i) for i in input().split())
a = [int(i) for i in input().split()]
b = a.copy()
k = 0
for i in a:
    b[k] = abs(i - d)
    k += 1
m = min(b)


def dec():
    i = m
    while i > 0:
        if m % i == 0:
            k = 0
            for j in b:
                if j % i == 0:
                    k += 1
                if k == len(b):
                    return i
            if i == m:
                i -= i // 2
        i -= 1


print((dec()))

import fractions

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
D = abs(x[0] - X)
for i in x:
    D = fractions.gcd(D, abs(i - X))
print(D)

-c, d = (int(i) for i in input().split()) -a = [int(i) for i in input().split()] -b = a.copy() -k = 0 -for i in a: -    b[k] = abs(i - d) -    k += 1 -m = min(b) +import fractions - -def dec(): -    i = m -    while i > 0: -        if m % i == 0: -            k = 0 -            for j in b: -                if j % i == 0: -                    k += 1 -                if k == len(b): -                    return i -            if i == m: -                i -= i // 2 -        i -= 1 - - -print((dec())) +N, X = list(map(int, input().split())) +x = list(map(int, input().split())) +D = abs(x[0] - X) +for i in x: +    D = fractions.gcd(D, abs(i - X)) +print(D)