from fractions import gcd

from functools import reduce



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

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

x.append(x_)

x.sort()

sa = [x[i+1]-x[i] for i in range(n)]

d = reduce(lambda a,b:gcd(a,b),sa)

print(d)
from fractions import gcd

from functools import reduce



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

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

x.append(x_)

sa = [abs(x[i+1]-x[i]) for i in range(n)]

d = reduce(lambda a,b:gcd(a,b),sa)

print(d)
from fractions import gcd
from functools import reduce

n, x_ = list(map(int, input().split()))
x = list(map(int, input().split()))
x.append(x_)
x.sort()
sa = [x[i + 1] - x[i] for i in range(n)]
d = reduce(lambda a, b: gcd(a, b), sa)
print(d)

from fractions import gcd
from functools import reduce

n, x_ = list(map(int, input().split()))
x = list(map(int, input().split()))
x.append(x_)
sa = [abs(x[i + 1] - x[i]) for i in range(n)]
d = reduce(lambda a, b: gcd(a, b), sa)
print(d)

-x.sort() -sa = [x[i + 1] - x[i] for i in range(n)] +sa = [abs(x[i + 1] - x[i]) for i in range(n)]