import fractions



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

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

x_.append(X)

x_.sort()



d_ = list(set([x_[i+1]-x_[i] for i in range(N)]))



gcd = d_[0]

for i in d_[1:]:

  gcd = fractions.gcd(gcd,i)

print(gcd)

  
from functools import reduce

from fractions import gcd

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

x = [abs(int(i)-x) for i in input().split()]

print((reduce(gcd,x)))

import fractions

N, X = list(map(int, input().split()))
x_ = list(map(int, input().split()))
x_.append(X)
x_.sort()
d_ = list(set([x_[i + 1] - x_[i] for i in range(N)]))
gcd = d_[0]
for i in d_[1:]:
    gcd = fractions.gcd(gcd, i)
print(gcd)

from functools import reduce
from fractions import gcd

n, x = list(map(int, input().split()))
x = [abs(int(i) - x) for i in input().split()]
print((reduce(gcd, x)))

-import fractions +from functools import reduce +from fractions import gcd -N, X = list(map(int, input().split())) -x_ = list(map(int, input().split())) -x_.append(X) -x_.sort() -d_ = list(set([x_[i + 1] - x_[i] for i in range(N)])) -gcd = d_[0] -for i in d_[1:]: -    gcd = fractions.gcd(gcd, i) -print(gcd) +n, x = list(map(int, input().split())) +x = [abs(int(i) - x) for i in input().split()] +print((reduce(gcd, x)))