from fractions import gcd

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

x=sorted(list(map(int,input().split()))+[d])

r=x[1]-x[0]

print((min(gcd(x[i+1]-x[i],r) for i in range(n))))
from functools import reduce

from fractions import gcd

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

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

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

n, d = list(map(int, input().split()))
x = sorted(list(map(int, input().split())) + [d])
r = x[1] - x[0]
print((min(gcd(x[i + 1] - x[i], r) for i in range(n))))

from functools import reduce
from fractions import gcd

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

+from functools import reduce -n, d = list(map(int, input().split())) -x = sorted(list(map(int, input().split())) + [d]) -r = x[1] - x[0] -print((min(gcd(x[i + 1] - x[i], r) for i in range(n)))) +N, X = list(map(int, input().split())) +x = [abs(X - int(i)) for i in input().split()] +print((reduce(gcd, x)))