def gcdf(a):

    a.sort()

    a0=a[0]

    a=[int(x%a0) for x in a if x%a0 != 0]

    if len(a)==0:

        return a0

    else:

        a.append(a0)

        a0=min(a)

        return gcdf(a) 

    

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

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



for i in range(n):

    if xi[i]>x:

        xi[i]=xi[i]-x

    else:

        xi[i]=x-xi[i]

    

gcdx=gcdf(xi)

print(gcdx)    


from functools import reduce

from fractions import gcd

#from math import gcd



n,x0=list(map(int,input().split()))

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



for i in range(n):

    x[i]=abs(x[i]-x0)



print((reduce(gcd, x)))

    

def gcdf(a):
    a.sort()
    a0 = a[0]
    a = [int(x % a0) for x in a if x % a0 != 0]
    if len(a) == 0:
        return a0
    else:
        a.append(a0)
        a0 = min(a)
        return gcdf(a)


n, x = list(map(int, input().split()))
xi = list(map(int, input().split()))
for i in range(n):
    if xi[i] > x:
        xi[i] = xi[i] - x
    else:
        xi[i] = x - xi[i]
gcdx = gcdf(xi)
print(gcdx)

from functools import reduce
from fractions import gcd

# from math import gcd
n, x0 = list(map(int, input().split()))
x = list(map(int, input().split()))
for i in range(n):
    x[i] = abs(x[i] - x0)
print((reduce(gcd, x)))

-def gcdf(a): -    a.sort() -    a0 = a[0] -    a = [int(x % a0) for x in a if x % a0 != 0] -    if len(a) == 0: -        return a0 -    else: -        a.append(a0) -        a0 = min(a) -        return gcdf(a) +from functools import reduce +from fractions import gcd - -n, x = list(map(int, input().split())) -xi = list(map(int, input().split())) +# from math import gcd +n, x0 = list(map(int, input().split())) +x = list(map(int, input().split())) -    if xi[i] > x: -        xi[i] = xi[i] - x -    else: -        xi[i] = x - xi[i] -gcdx = gcdf(xi) -print(gcdx) +    x[i] = abs(x[i] - x0) +print((reduce(gcd, x)))