from fractions import gcd

N, *X = list(map(int, open(0).read().split()))

X.sort()

y = [X[i + 1] - X[i] for i in range(N)]



ans = y[0]

for v in y[1:]:

  ans = gcd(ans, v)

print(ans)

from fractions import gcd

from functools import reduce

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

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

y = [abs(x[i] - X) for i in range(N)]

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

N, *X = list(map(int, open(0).read().split()))
X.sort()
y = [X[i + 1] - X[i] for i in range(N)]
ans = y[0]
for v in y[1:]:
    ans = gcd(ans, v)
print(ans)

from fractions import gcd
from functools import reduce

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

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