import numpy as np

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



A=np.array(list(map(int, input().split())))

B=A-X

if N==1:

  print((abs(B[0])))

  exit()



from fractions import gcd

GCD=gcd(abs(B[0]),abs(B[1]))

#print(B)

if N>2:

  for i in range(2,N):

    GCD=gcd(GCD, abs(B[i]))

    

  

print(GCD)



from fractions import gcd

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



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

L=[0]*N

for i in range(N):

    L[i]=abs(x[i]-X)

g=L[0]

for i in range(1,N):

    g=gcd(g,L[i])



print(g)
import numpy as np

N, X = list(map(int, input().split()))
A = np.array(list(map(int, input().split())))
B = A - X
if N == 1:
    print((abs(B[0])))
    exit()
from fractions import gcd

GCD = gcd(abs(B[0]), abs(B[1]))
# print(B)
if N > 2:
    for i in range(2, N):
        GCD = gcd(GCD, abs(B[i]))
print(GCD)

from fractions import gcd

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
L = [0] * N
for i in range(N):
    L[i] = abs(x[i] - X)
g = L[0]
for i in range(1, N):
    g = gcd(g, L[i])
print(g)

-import numpy as np +from fractions import gcd -A = np.array(list(map(int, input().split()))) -B = A - X -if N == 1: -    print((abs(B[0]))) -    exit() -from fractions import gcd - -GCD = gcd(abs(B[0]), abs(B[1])) -# print(B) -if N > 2: -    for i in range(2, N): -        GCD = gcd(GCD, abs(B[i])) -print(GCD) +x = list(map(int, input().split())) +L = [0] * N +for i in range(N): +    L[i] = abs(x[i] - X) +g = L[0] +for i in range(1, N): +    g = gcd(g, L[i]) +print(g)