from fractions import gcd

from functools import reduce



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

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

new_xlist = [(x - xlist[0]) for x in xlist]

X -= xlist[0]

print((abs(reduce(gcd, new_xlist + [X]))))
import fractions

import functools



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

cities = []

for city in list(map(int, input().split())):

    cities.append(city - X)

gcd = functools.reduce(fractions.gcd, cities)

print((gcd if gcd > 0 else -gcd))
from fractions import gcd
from functools import reduce

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

import fractions
import functools

N, X = list(map(int, input().split()))
cities = []
for city in list(map(int, input().split())):
    cities.append(city - X)
gcd = functools.reduce(fractions.gcd, cities)
print((gcd if gcd > 0 else -gcd))

-from fractions import gcd -from functools import reduce +import fractions +import functools -xlist = list(map(int, input().split())) -new_xlist = [(x - xlist[0]) for x in xlist] -X -= xlist[0] -print((abs(reduce(gcd, new_xlist + [X])))) +cities = [] +for city in list(map(int, input().split())): +    cities.append(city - X) +gcd = functools.reduce(fractions.gcd, cities) +print((gcd if gcd > 0 else -gcd))