from fractions import gcd

from functools import reduce

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

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

X=sorted(X+[D])

m=min(X)

s=[X[i]-m for i in range(1,len(X))]

print((reduce(gcd,s)))
from fractions import gcd

from functools import reduce

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

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

print((reduce(gcd,x)))
from fractions import gcd
from functools import reduce

N, D = list(map(int, input().split()))
X = list(map(int, input().split()))
X = sorted(X + [D])
m = min(X)
s = [X[i] - m for i in range(1, len(X))]
print((reduce(gcd, s)))

from fractions import gcd
from functools import reduce

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

-N, D = list(map(int, input().split())) -X = list(map(int, input().split())) -X = sorted(X + [D]) -m = min(X) -s = [X[i] - m for i in range(1, len(X))] -print((reduce(gcd, s))) +N, X = list(map(int, input().split())) +x = [abs(X - i) for i in map(int, input().split())] +print((reduce(gcd, x)))