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

W = list(map(int,input().split())) + [X]

W = sorted(W)

dist = 10**18

if len(W) == 2:

  print((W[1]-W[0]))

  exit()

for i in range(1,N+1):

  dist = min(dist, W[i]-W[i-1])

  while (W[i]-W[i-1])%dist != 0:

    dist -= 1

  if dist == 1:

    break

print(dist)
from functools import reduce

from fractions import gcd

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

W = list(map(int,input().split())) + [X]

W = sorted(W)

sa_w = [W[i+1] - W[i] for i in range(N)]

ans = reduce(gcd, sa_w)

print(ans)
N, X = list(map(int, input().split()))
W = list(map(int, input().split())) + [X]
W = sorted(W)
dist = 10**18
if len(W) == 2:
    print((W[1] - W[0]))
    exit()
for i in range(1, N + 1):
    dist = min(dist, W[i] - W[i - 1])
    while (W[i] - W[i - 1]) % dist != 0:
        dist -= 1
    if dist == 1:
        break
print(dist)

from functools import reduce
from fractions import gcd

N, X = list(map(int, input().split()))
W = list(map(int, input().split())) + [X]
W = sorted(W)
sa_w = [W[i + 1] - W[i] for i in range(N)]
ans = reduce(gcd, sa_w)
print(ans)

+from functools import reduce +from fractions import gcd + -dist = 10**18 -if len(W) == 2: -    print((W[1] - W[0])) -    exit() -for i in range(1, N + 1): -    dist = min(dist, W[i] - W[i - 1]) -    while (W[i] - W[i - 1]) % dist != 0: -        dist -= 1 -    if dist == 1: -        break -print(dist) +sa_w = [W[i + 1] - W[i] for i in range(N)] +ans = reduce(gcd, sa_w) +print(ans)