There are N cities on a number line. The i-th city is located at coordinate x_i.
Your objective is to visit all these cities at least once.
In order to do so, you will first set a positive integer D.
Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:
 - Move 1: travel from coordinate y to coordinate y + D.
 - Move 2: travel from coordinate y to coordinate y - D.
Find the maximum value of D that enables you to visit all the cities.
Here, to visit a city is to travel to the coordinate where that city is located.

-----Constraints-----
 - All values in input are integers.
 - 1 \leq N \leq 10^5
 - 1 \leq X \leq 10^9
 - 1 \leq x_i \leq 10^9
 - x_i are all different.
 - x_1, x_2, ..., x_N \neq X

-----Input-----
Input is given from Standard Input in the following format:
N X
x_1 x_2 ... x_N

-----Output-----
Print the maximum value of D that enables you to visit all the cities.

-----Sample Input-----
3 3
1 7 11

-----Sample Output-----
2

Setting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.
 - Perform Move 2 to travel to coordinate 1.
 - Perform Move 1 to travel to coordinate 3.
 - Perform Move 1 to travel to coordinate 5.
 - Perform Move 1 to travel to coordinate 7.
 - Perform Move 1 to travel to coordinate 9.
 - Perform Move 1 to travel to coordinate 11.

Difficulty: EASY

Solutions:
import math
(N, X) = map(int, input().split())
lsx = list(map(int, input().split()))
lsx.sort()
gcd = abs(lsx[0] - X)
for i in range(1, N):
	gcd = math.gcd(gcd, lsx[i] - lsx[i - 1])
print(gcd)


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


from math import gcd
from functools import reduce
(_, X) = map(int, input().split())
print(reduce(gcd, (abs(i - X) for i in set(map(int, input().split())))))


from math import gcd
(N, X) = map(int, input().split())
x = list(map(int, input().split()))
if N == 1:
	print(abs(X - x[0]))
else:
	l = []
	for i in range(N):
		l_ = abs(X - x[i])
		l.append(l_)
	ans = l[0]
	for i in range(1, len(l)):
		ans = gcd(ans, l[i])
	print(ans)


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


from functools import reduce
from math import gcd
(n, x) = map(int, input().split())
a = [abs(int(A) - x) for A in input().split()]
a.sort()
print(reduce(gcd, a))


import functools

def euclid(a, b):
	if b == 0:
		return a
	else:
		return euclid(b, a % b)

def gcd(nums):
	if len(nums) == 1:
		return nums[0]
	return functools.reduce(euclid, nums)
(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
a.append(k)
a.sort()
sa = []
for i in range(1, n + 1):
	sa.append(a[i] - a[i - 1])
print(gcd(sa))


import math
(n, s) = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
for i in a:
	ans = math.gcd(ans, abs(i - s))
print(ans)


import math, sys
(N, X) = map(int, input().split())
x = list(map(int, input().split()))
Distance = [abs(X - x[i]) for i in range(N)]
if N == 1:
	print(abs(X - x[0]))
	return
ans = 0
for i in range(N):
	ans = math.gcd(ans, Distance[i])
print(ans)


f = lambda : map(int, input().split())
(n, x) = f()
d = [abs(i - x) for i in f()]
from math import *
a = d.pop()
for i in d:
	a = gcd(a, i)
print(a)


(n, x) = map(int, input().split())
X = tuple(map(lambda k: abs(int(k) - x), input().split()))
from math import gcd
from functools import reduce
ans = reduce(gcd, X)
print(ans)


import math
(N, X) = map(int, input().split())
x = list(map(int, input().split()))
x.append(X)
x.sort()
d = []
if N == 1:
	print(x[1] - x[0])
	return
for i in range(N):
	d.append(x[i + 1] - x[i])
gc = math.gcd(d[0], d[1])
for i in range(N):
	gc = math.gcd(d[i], gc)
print(gc)


def make_divisors(n):
	(lower_divisors, upper_divisors) = ([], [])
	i = 1
	while i * i <= n:
		if n % i == 0:
			lower_divisors.append(i)
			if i != n // i:
				upper_divisors.append(n // i)
		i += 1
	return lower_divisors + upper_divisors[::-1]
a = [int(s) for s in input().split()]
N = a[0]
st = a[1]
mini = int(-1)
b = [int(s) for s in input().split()]
for i in range(N):
	if abs(b[i] - st) < mini or mini == -1:
		mini = abs(b[i] - st)
yakulist = make_divisors(mini)
gyakulist = sorted(yakulist, reverse=True)
kazu = len(gyakulist)
flag = int(0)
for i in range(kazu):
	for j in range(N):
		if abs(b[j] - st) % gyakulist[i] != 0:
			flag = 1
		else:
			pass
	if flag == 0:
		print(gyakulist[i])
		break
	else:
		flag = 0


import math
(n, x) = map(int, input().split())
l = list(map(int, input().split()))
d = abs(l[0] - x)
for m in l:
	d2 = math.gcd(d, abs(m - x))
	d = min(d, d2)
print(d)


from fractions import *
from functools import *
(n, x, *a) = map(int, open(0).read().split())
b = [abs(x - i) for i in a]
print(reduce(gcd, b))


import sys, math
(n, x) = map(int, sys.stdin.readline().split())
xl = [*map(int, sys.stdin.readline().split())]
yl = [abs(x - i) for i in xl]
d = yl[0]
for i in range(n):
	d = math.gcd(d, yl[i])
print(d)


(N, X) = map(int, input().split())
List = list(map(int, input().split()))
abs_List = [abs(List[i] - X) for i in range(N)]
import math
from functools import reduce

def gcd(*numbers):
	return reduce(math.gcd, numbers)

def gcd_list(numbers):
	return reduce(math.gcd, numbers)
print(gcd(*abs_List))


(n, x) = list(map(int, input().split()))
pos = list(map(int, input().split()))
diff_pos = [abs(s - x) for s in pos]
min_diff = min(diff_pos)
ans = 0

def main():
	for i in range(min_diff, 0, -1):
		for n in diff_pos:
			if n % i != 0:
				break
			if n == diff_pos[-1]:
				return i
print(main())


from math import gcd
(n, x) = map(int, input().split())
X = list(map(int, input().split()))
X.append(x)
X.sort()
g = X[1] - X[0]
for i in range(n):
	g = gcd(g, X[i + 1] - X[i])
print(g)


def gcd(x, y):
	if y == 0:
		return x
	else:
		return gcd(y, x % y)
(n, x) = map(int, input().split())
xxx = list(map(lambda xn: abs(int(xn) - x), input().split()))
ans = xxx[0]
for i in range(1, n):
	ans = gcd(ans, xxx[i])
print(ans)


import sys
import math
input = sys.stdin.readline
(N, X) = map(int, input().split())
A = list(map(int, input().split()))
gcd = abs(X - A[0])
for a_i in A:
	gcd = math.gcd(gcd, abs(X - a_i))
print(gcd)


from math import gcd
(N, X) = map(int, input().split())
L = list(map(lambda x: int(x) - X, input().split()))
a = L[0]
for b in L:
	a = gcd(a, b)
print(a)


from math import gcd
(n, x) = map(int, input().split())
x = list(map(lambda xi: abs(int(xi) - x), input().split()))
g = x[0]
for xi in x:
	g = gcd(g, xi)
print(g)


f = lambda : [*map(int, input().split())]
(n, x) = f()
l = f()
d = [l[i + 1] - l[i] for i in range(n - 1)]
a = abs(x - l[0])
from math import *
for i in d:
	a = gcd(a, i)
print(a)


(N, X) = map(int, input().split())
(*C,) = map(int, input().split())
t = [abs(c - X) for c in C]
import math
from functools import reduce
print(reduce(math.gcd, t))


import math
from functools import reduce
(N, X) = map(int, input().split())
x = list(map(int, input().split()))
x.append(X)
x = [y - X for y in x]
print(reduce(math.gcd, x))


import math
from functools import reduce

def gcd(*numbers):
	return reduce(math.gcd, numbers)
(n, x) = map(int, input().split())
xx = list(map(int, input().split()))
a = [abs(x - i) for i in xx]
print(gcd(*a))


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def mapt(fn, *args):
	return list(map(fn, *args))

def Input():
	return mapt(int, input().split(' '))

def main():
	(N, X) = Input()
	x = Input()
	if N == 1:
		print(abs(x[0] - X))
		return
	x.append(X)
	x.sort()
	data = [abs(x[i] - x[i + 1]) for i in range(N)]
	ans = data[0]
	for i in range(1, N):
		ans = gcd(data[i], ans)
	print(ans)
main()


import math
(N, X) = map(int, input().split())
xl = [abs(x - X) for x in map(int, input().split())]
ans = xl[0]
for x in xl[1:]:
	ans = math.gcd(ans, x)
print(ans)


from fractions import *
(n, *a) = map(int, open(0).read().split())
a.sort()
b = [i - j for (i, j) in zip(a[1:], a)]
c = b[0]
for i in b:
	c = gcd(i, c)
print(c)


import math
from functools import reduce

def gcd_list(numbers):
	return reduce(math.gcd, numbers)
(N, X) = list(map(int, input().split()))
x = sorted(list(list(map(int, input().split()))))
y = [abs(i - X) for i in x]
print(gcd_list(y))


(n, x) = list(map(int, input().split()))
xi = list(map(int, input().split()))
xi.sort()
diff = []
for i in range(n):
	diff.append(abs(xi[i] - x))
import numpy
print(numpy.gcd.reduce(diff))


from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement
from functools import reduce

def gcd_list(numbers):
	return reduce(gcd, numbers)
(N, X) = [int(_) for _ in input().split()]
x = [int(_) for _ in input().split()]
if N != 1:
	ret = []
	x.append(X)
	now = x[0]
	for i in x[1:]:
		ret += [i - now]
		now = i
	ret = sorted(ret)
	print(gcd_list(ret))
else:
	print(abs(x[0] - X))


import math
(N, X) = map(int, input().split())
x = list(map(int, input().split()))
x.append(X)
x.sort()
diff = [x[i + 1] - x[i] for i in range(N)]
ans = diff[0]
for i in range(1, N):
	ans = math.gcd(ans, diff[i])
print(ans)


from functools import reduce
from math import gcd
(n, x) = map(int, input().split())
print(reduce(gcd, (abs(ai - x) for ai in map(int, input().split()))))


import math
(n, a) = map(int, input().split())
x = list(map(int, input().split())) + [a]
x.sort()
if n == 1:
	print(abs(x[0] - x[1]))
	return
res = x[1] - x[0]
for i in range(1, n):
	res = math.gcd(res, x[i + 1] - x[i])
print(res)


import math
(n, x) = map(int, input().split())
xl = list(map(int, input().split()))
dis = []
ans = 0
for i in range(n):
	dis.append(abs(x - xl[i]))
for i in range(n):
	ans = math.gcd(ans, dis[i])
print(ans)


from functools import reduce
from math import gcd
(N, X) = map(int, input().split())
a = list(map(int, input().split()))
print(reduce(gcd, (abs(a[i] - X) for i in range(N))))


import math
(n, x) = map(int, input().split())
num_list = list(map(int, input().split()))
res = 0
for i in num_list:
	res = math.gcd(res, abs(i - x))
print(res)


import sys
MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.141592653589793

def read_str():
	return sys.stdin.readline().strip()

def read_int():
	return int(sys.stdin.readline().strip())

def read_ints():
	return map(int, sys.stdin.readline().strip().split())

def read_ints2(x):
	return map(lambda num: int(num) - x, sys.stdin.readline().strip().split())

def read_str_list():
	return list(sys.stdin.readline().strip().split())

def read_int_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def GCD(a: int, b: int) -> int:
	return b if a % b == 0 else GCD(b, a % b)

def LCM(a: int, b: int) -> int:
	return a * b // GCD(a, b)

def Main():
	(n, x) = read_ints()
	d = read_int_list()
	ans = abs(x - d[0])
	for i in range(1, n):
		ans = GCD(ans, abs(x - d[i]))
	print(ans)

def __starting_point():
	Main()
__starting_point()


def gcd(a, b):
	while a != 0 and b != 0:
		if a > b:
			c = a
			a = b
			b = c
		b %= a
	return max(a, b)
(n, x) = map(int, input().split())
d = sorted(list(map(lambda a: abs(a - x), list(map(int, input().split())))))
now = d[0]
for i in d[1:]:
	now = gcd(now, i)
print(now)


def gcd(a, b):
	(a, b) = (a, b) if a >= b else (b, a)
	if b == 0:
		return a
	return gcd(b, a % b)

def solve(N, X, x):
	x_abs = [abs(X - xi) for xi in x]
	ans = x_abs[0]
	for xi in x_abs[1:]:
		ans = gcd(ans, xi)
	print(ans)

def __starting_point():
	(N, X) = list(map(int, input().split()))
	x = [int(i) for i in input().split()]
	solve(N, X, x)
__starting_point()


import functools
import math
(N, X) = [int(i) for i in input().split()]
x_list = [abs(int(i) - X) for i in input().split()]
D = functools.reduce(lambda acc, x: math.gcd(acc, x), x_list, 0)
print(D)


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return abs(a)

def solve(x_list):
	ans = 0
	for x in x_list:
		ans = gcd(ans, x)
	return ans
(N, X) = map(int, input().split())
x_list = list((abs(int(x) - X) for x in input().split()))
print(solve(x_list))


def resolve():
	from math import gcd
	(_, X) = [int(i) for i in input().split()]
	xx = [int(i) for i in input().split()]
	ans = abs(X - xx[0])
	for x in xx:
		ans = gcd(ans, abs(X - x))
	print(ans)

def __starting_point():
	resolve()
__starting_point()


import functools
import math
(N, X) = [int(i) for i in input().split()]
x_list = [int(i) for i in input().split()]
x_list.append(X)
num_list = sorted(x_list)
tmp = [abs(x[0] - x[1]) for x in zip(num_list[:-1], num_list[1:])]
D = functools.reduce(lambda acc, x: math.gcd(acc, x), tmp, 0)
print(D)


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
(n, x) = map(int, input().split())
a = [abs(i - x) for i in list(map(int, input().split()))]
x = a[-1]
for i in a[:-1]:
	x = gcd(x, i)
print(x)


from math import gcd
(n, x0) = list(map(int, input().split()))
x = [abs(_x - x0) for _x in list(map(int, input().split()))]
x.sort()
ans = x[0]
for i in range(n):
	ans = gcd(ans, x[i])
print(ans)


import math
(n, x) = map(int, input().split())
X = list(map(int, input().split()))
ans = []
for xx in X:
	ans.append(abs(x - xx))
a = ans[0]
for aa in ans:
	a = math.gcd(aa, a)
print(a)


from math import gcd
(N, X) = map(int, input().split())
A = [abs(int(x) - X) for x in input().split()]
ans = A[0]
for i in range(N):
	ans = gcd(ans, A[i])
print(ans)


from math import gcd
(n, x) = map(int, input().split())
a = [int(i) - x for i in list(map(int, input().split()))]
now = a[0]
for i in a:
	now = gcd(now, i)
print(now)


import math
from functools import reduce

def gcd(*numbers):
	return reduce(math.gcd, numbers)

def gcd_list(numbers):
	return reduce(math.gcd, numbers)
(n, x) = map(int, input().split())
a = list(map(int, input().split()))
a.append(x)
a.sort()
d = set()
for i in range(n):
	d.add(a[i + 1] - a[i])
d = list(d)
ans = gcd_list(d)
print(ans)


import math
(N, X) = map(int, input().split())
l = list(map(int, input().split()))
D = abs(l[0] - X)
for i in range(N):
	D = math.gcd(D, abs(l[i] - X))
print(D)


import sys
import math
input = sys.stdin.readline

def main():
	(N, X) = map(int, input().split())
	x = list(map(int, input().split()))
	x.append(X)
	ans = abs(x[0] - X)
	for i in range(N):
		ans = math.gcd(ans, abs(x[i] - x[i + 1]))
	print(ans)

def __starting_point():
	main()
__starting_point()


(n, x) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
for i in range(n):
	a[i] = abs(a[i] - x)

def gcd(x, y):
	while y != 0:
		(x, y) = (y, x % y)
	return x
res = a[0]
for i in range(n):
	res = gcd(res, a[i])
print(res)


from math import *
(N, x) = map(int, input().split())
(*X,) = map(int, input().split())
ans = abs(X[0] - x)
now = X[0]
for i in X[1:]:
	ans = gcd(ans, abs(i - now))
	now = i
print(ans)


import math

def gcd_list(nums):
	gcd = nums[0]
	for i in range(1, len(nums)):
		gcd = math.gcd(gcd, nums[i])
	return gcd
(N, X) = map(int, input().split())
x = list(map(int, input().split()))
x = [abs(i - X) for i in x]
print(gcd_list(x))


(n, x) = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = []
for i in range(n):
	ylist.append(xlist[i] - x)
import math
ans = ylist[0]
for i in range(n):
	ans = math.gcd(ans, ylist[i])
print(ans)


(n, x) = map(int, input().split())
al = list(map(int, input().split()))
import math
temp = abs(x - al[0])
for i in range(1, n):
	y = al[i] - al[i - 1]
	temp = math.gcd(temp, y)
print(temp)


import math
from functools import reduce

def gcd(numbers):
	return reduce(math.gcd, numbers)
a = list(map(int, input().split()))
b = list(map(int, input().split()))
b.append(a[1])
c = sorted(b)
d = []
for i in range(a[0]):
	d.append(c[i + 1] - c[i])
print(gcd(d))


import math
(n, x) = map(int, input().split())
a = list(map(int, input().split()))
g = 0
for y in a:
	g = math.gcd(g, abs(y - x))
print(g)


import math
(n, x) = map(int, input().split())
xi = list(map(int, input().split()))
xi = list(map(lambda z: abs(z - x), xi))
g = xi[0]
for i in range(1, n):
	g = math.gcd(g, xi[i])
print(g)


import math
(N, X) = map(int, input().split())
cities = list(map(lambda x: int(x) - X, input().split()))
res = abs(cities[0])
for i in range(1, N):
	res = math.gcd(res, cities[i])
print(res)


import math
(N, X) = map(int, input().split())
xs = list(map(int, input().split()))
dist = []
for i in range(N):
	dist.append(abs(xs[i] - X))
ans = dist[0]
for d in dist[1:]:
	ans = math.gcd(ans, d)
print(ans)


(n, x) = map(int, input().split())
L = list(map(int, input().split()))
L.append(x)
L.sort()
D = []
for i in range(n):
	d = L[i + 1] - L[i]
	D.append(d)
import math
ans = D[0]
for i in range(1, n):
	ans = math.gcd(ans, D[i])
print(ans)


from math import gcd
(n, x) = list(map(int, input().split()))
ls = sorted(list(map(int, input().split())))
if x == 1:
	print(abs(x - ls[0]))
	return
distant = []
for i in range(n):
	diff = abs(ls[i] - x)
	distant.append(diff)
distant.sort()
a = distant[0]
for i in distant:
	g = gcd(a, i)
	a = g
print(g)


from functools import reduce

def g(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
X = int(input().split()[1])
print(reduce(g, map(lambda x: abs(int(x) - X), input().split())))


import math
from functools import reduce

def gcd(list):
	return reduce(math.gcd, list)
(n, x) = map(int, input().split())
a = map(lambda b: abs(int(b) - x), input().split())
print(gcd(a))


import math
(n, m) = map(int, input().split())
x = [int(x) for x in input().split()]
mi = min(x)
l = [abs(x[i] - x[i + 1]) for i in range(n - 1)]
ans = abs(mi - m)
for i in l:
	ans = math.gcd(ans, i)
print(ans)


from functools import reduce
from math import gcd
(n, x) = map(int, input().split())
L = [abs(x - int(i)) for i in input().split()]
print(reduce(gcd, L))


import math
(N, X) = map(int, input().split())
x = list(map(int, input().split()))
ls = []
for i in range(N):
	ls.append(abs(x[i] - X))
now = ls[0]
for i in range(1, N):
	now = math.gcd(ls[i], now)
print(now)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
a.append(x)
a = sorted(a)
diff_list = [0] * n
for i in range(1, n + 1):
	diff_list[i - 1] = a[i] - a[i - 1]
g = diff_list[0]
import math
for i in range(1, n):
	g = math.gcd(g, diff_list[i])
print(g)


import math
(n, x) = map(int, input().split())
l = [abs(x - i) for i in list(map(int, input().split()))]
r = 0
for i in range(len(l)):
	r = math.gcd(r, l[i])
print(r)


from fractions import *
(_, X, *x) = map(int, open(0).read().split())
(s, *x) = [abs(X - t) for t in x]
for t in x:
	s = gcd(s, t)
print(s)


def main():
	import math
	import sys
	pin = sys.stdin.readline
	pout = sys.stdout.write
	perr = sys.stderr.write
	(N, X) = map(int, pin().split())
	x = list(map(int, pin().split()))
	m = abs(x[0] - X)
	for i in range(1, N):
		m = math.gcd(abs(x[i] - X), m)
	print(m)
	return
main()


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


from math import gcd
(N, X) = list(map(int, input().split()))
xs = list(map(int, input().split()))
aX = list([abs(x - X) for x in xs])
ans = aX[0]
for i in range(1, N):
	ans = gcd(ans, aX[i])
print(ans)


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


import math
from math import gcd, pi, sqrt
INF = float('inf')
import sys
sys.setrecursionlimit(10 ** 6)
import itertools
from collections import Counter, deque

def i_input():
	return int(input())

def i_map():
	return list(map(int, input().split()))

def i_list():
	return list(i_map())

def i_row(N):
	return [i_input() for _ in range(N)]

def i_row_list(N):
	return [i_list() for _ in range(N)]

def s_input():
	return input()

def s_map():
	return input().split()

def s_list():
	return list(s_map())

def s_row(N):
	return [s_input for _ in range(N)]

def s_row_str(N):
	return [s_list() for _ in range(N)]

def s_row_list(N):
	return [list(s_input()) for _ in range(N)]
import string

def main():
	(N, X) = i_map()
	x = i_list()
	l = []
	for i in x:
		l.append(abs(X - i))
	ans = l[0]
	for k in l[1:]:
		ans = gcd(ans, k)
	print(ans)

def __starting_point():
	main()
__starting_point()


import math
from functools import reduce
from sys import setrecursionlimit
setrecursionlimit(10 ** 6)

def gcd(*numbers):
	return reduce(math.gcd, numbers)
(n, x) = map(int, input().split())
xl = list(map(int, input().split()))
xl = list(map(lambda y: abs(y - x), xl))
ans = -1
if len(xl) == 1:
	ans = xl[0]
else:
	ans = gcd(*xl)
print(ans)


(N, X) = map(int, input().split())
x = list(map(int, input().split()))
x = sorted([abs(i - X) for i in x])
y = x[0]
for i in range(1, N):
	z = x[i]
	(y, z) = (max(y, z), min(y, z))
	while z != 0:
		(y, z) = (z, y % z)
print(y)


from math import gcd
(n, X) = map(int, input().split())
xlst = list(map(int, input().split()))
ans = X - xlst[0]
for x in xlst:
	ans = gcd(ans, X - x)
print(ans)


import math
from functools import reduce

def gcd_list(numbers):
	return reduce(math.gcd, numbers)
(N, X) = map(int, input().split())
x_list = [X] + list(map(int, input().split()))
x_list.sort()
dist = [0] * (N + 1)
for i in range(N):
	dist[i] += x_list[i + 1] - x_list[i]
ans = gcd_list(dist)
print(ans)


import math
(n, x) = map(int, input().split())
a = [int(x) for x in input().split()]
ans = abs(x - a[0])
for i in range(1, n):
	ans = math.gcd(abs(x - a[i]), ans)
print(ans)


from functools import reduce
from math import gcd
(n, X, *x) = map(int, open(0).read().split())
x = [abs(i - X) for i in x]
print(reduce(gcd, x))


(n, x) = map(int, input().split())
li = list(input().split())
li = [abs(int(a) - x) for a in li]

def gcd(a, b):
	while a % b != 0:
		(a, b) = (b, a % b)
	return b
from functools import reduce
a = reduce(gcd, li)
print(a)


from math import gcd
(n, x) = map(int, input().split())
m = [x] + list(map(int, input().split()))
m.sort()
if n == 1:
	print(m[1] - m[0])
else:
	res = gcd(m[1] - m[0], m[2] - m[1])
	for i in range(1, n - 1):
		a = m[i + 1] - m[i]
		b = m[i + 2] - m[i + 1]
		if res >= gcd(a, b):
			if res % gcd(a, b) == 0:
				res = gcd(a, b)
			else:
				res = gcd(res, gcd(a, b))
		elif gcd(a, b) % res != 0:
			res = gcd(res, gcd(a, b))
	print(res)


import bisect
import math
(N, X) = map(int, input().split())
x = list(map(int, input().split()))
x = sorted(x, reverse=False)
bisect.insort_left(x, X)
d_lis = []
for i in range(len(x) - 1):
	d = x[i + 1] - x[i]
	d_lis.append(d)
d_lis = sorted(d_lis, reverse=False)
ans = d_lis[0]
for j in range(1, len(d_lis)):
	ans = math.gcd(ans, d_lis[j])
print(ans)


import math
(N, X) = map(int, input().split())
x = list(map(int, input().split()))
y = [abs(x[i] - X) for i in range(N)]
if N == 1:
	print(y[0])
	return
ans = math.gcd(y[0], y[1])
for i in range(2, N):
	ans = min(ans, math.gcd(y[i], ans))
print(ans)


import math
(N, X) = map(int, input().split())
xs = list(map(int, input().split()))
diffs = []
g = abs(X - xs[0])
for i in range(1, N):
	g = math.gcd(g, abs(X - xs[i]))
print(g)


import math
from functools import reduce

def gcd(*numbers):
	return reduce(math.gcd, numbers)

def main():
	(n, X) = list(map(int, input().split()))
	x = list(map(int, input().split()))
	x.append(X)
	x.sort()
	x_dist = [x[i + 1] - x[i] for i in range(len(x) - 1)]
	print(gcd(*x_dist))

def __starting_point():
	main()
__starting_point()


(n, x, *l) = map(int, open(0).read().split())
from math import *
a = 0
for i in l:
	a = gcd(a, abs(i - x))
print(a)


from math import gcd
(N, X) = list(map(int, input().split()))
x = list(map(int, input().split()))
dis = []
for i in range(N):
	dis.append(abs(X - x[i]))
res = 0
for i in range(N):
	res = gcd(res, dis[i])
print(res)


from fractions import *
(n, x, *l) = map(int, open(0).read().split())
g = abs(l[0] - x)
for (a, b) in zip([x] + l, l):
	g = gcd(g, abs(b - a))
print(g)


import numpy as np
(n, X) = map(int, input().split())
x = list(map(int, input().split()))
x.append(X)
x = sorted(x)
dis = []
for i in range(n):
	dis.append(x[i + 1] - x[i])
print(np.gcd.reduce(dis))


import sys
import math
from functools import reduce
(n, k) = map(int, input().split())
x = list(map(int, input().split()))
l = []
for i in x:
	b = abs(i - k)
	l.append(b)

def gcd_list(numbers):
	return reduce(math.gcd, numbers)
ans = gcd_list(l)
print(ans)


import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
input = sys.stdin.readline

def RD():
	return input().rstrip()

def F():
	return float(input().rstrip())

def I():
	return int(input().rstrip())

def MI():
	return map(int, input().split())

def MF():
	return map(float, input().split())

def LI():
	return list(map(int, input().split()))

def TI():
	return tuple(map(int, input().split()))

def LF():
	return list(map(float, input().split()))

def Init(H, W, num):
	return [[num for i in range(W)] for j in range(H)]

def main():
	(N, X) = MI()
	L = LI()
	L = [abs(i - X) for i in L]
	ans = L[0]
	for i in L:
		ans = math.gcd(ans, i)
	print(ans)

def __starting_point():
	main()
__starting_point()


(n, x) = map(int, input().split())
X = list(map(int, input().split()))
for i in range(n):
	X[i] = abs(X[i] - x)
from math import gcd
ans = X[0]
for i in range(1, n):
	ans = gcd(ans, X[i])
print(ans)


import math
from functools import reduce
(n, x) = map(int, input().split())
a = list(map(int, input().split()))
a.append(x)
b = []
for i in range(len(a) - 1):
	b.append(abs(a[i] - a[i - 1]))

def gcd(*numbers):
	return reduce(math.gcd, numbers)
print(gcd(*b))


from math import gcd

def readinput():
	(n, x) = list(map(int, input().split()))
	xx = list(map(int, input().split()))
	return (n, x, xx)

def main(n, x, xx):
	y = [0] * len(xx)
	for i in range(len(xx)):
		y[i] = abs(xx[i] - x)
	if len(y) == 1:
		ans = y[0]
	else:
		ans = gcd(y[0], y[1])
		for i in range(2, n):
			ans = gcd(ans, y[i])
	return ans

def __starting_point():
	(n, x, xx) = readinput()
	ans = main(n, x, xx)
	print(ans)
__starting_point()


import math
(N, X) = map(int, input().split())
L = list(map(int, input().split()))
L.append(X)
L = sorted(L)
m = L[1] - L[0]
for i in range(N):
	m = math.gcd(m, L[i + 1] - L[i])
print(m)


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


import math
(N, X) = map(int, input().split())
x = list(map(int, input().split()))
absx = [abs(X - xx) for xx in x]
absx.sort()
divx0 = []
for i in range(math.ceil(math.sqrt(absx[0])), 0, -1):
	if absx[0] % i == 0:
		divx0.append(i)
t = []
for x in divx0:
	t.append(x)
	t.append(absx[0] // x)
divx0 = t
divx0.sort(reverse=True)
for dx0 in divx0:
	isok = True
	for xx in absx:
		if xx % dx0 != 0:
			isok = False
			break
	if isok:
		print(dx0)
		return


(N, X) = list(map(int, input().split()))
import math
a = list(map(int, input().split()))
a.append(X)
a.sort()
S = []
for i in range(N):
	S.append(a[i + 1] - a[i])
ans = S[0]
for j in range(1, N):
	ans = math.gcd(ans, S[j])
print(ans)


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


(n, x) = map(int, input().split())
xlist = list(map(int, input().split()))
if n == 1:
	print(abs(xlist[0] - x))
	return
ylist = []
for i in range(n):
	ylist.append(abs(xlist[i] - x))
from functools import reduce
from math import gcd
print(reduce(gcd, ylist))


import sys
import math
sys.setrecursionlimit(10 ** 8)
ini = lambda : int(sys.stdin.readline())
inl = lambda : [int(x) for x in sys.stdin.readline().split()]
ins = lambda : sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print('\x1b[33m', *a, '\x1b[0m', **dict(file=sys.stderr, **kw))

def solve():
	(n, start) = inl()
	X = inl()
	g = None
	for x in X:
		d = abs(x - start)
		if g is None:
			g = d
		else:
			g = math.gcd(g, d)
	return g
print(solve())


import math
from functools import reduce
(N, A) = map(int, input().split())
X = list(map(int, input().split()))
L = [abs(x - A) for x in X]
print(reduce(math.gcd, L))