#import math

#import fractions

from functools import reduce



'''

def gcdList(ls):

    return reduce(math.gcd, ls)

#    return reduce(fractions.gcd, ls)

'''



def gcd(a,b):

    while b:

        a, b = b, a % b

    return a

def gcdList(ls):

    return reduce(gcd,ls)



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

x = sorted([int(i) for i in input().split()])

x_ = [0 for _ in range(n)]

for i in range(n):

    x_[i] = abs(y-x[i])

print((gcdList(x_)))
from fractions import gcd

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

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

a = []

for i in range(n):

    a.append(abs(X-x[i]))

if n > 1:

    b = gcd(a[0],a[1])

else:

    b = a[0]

for i in range(n):

    b = gcd(b,a[i])

print(b)
# import math
# import fractions
from functools import reduce

"""
def gcdList(ls):
    return reduce(math.gcd, ls)
#    return reduce(fractions.gcd, ls)
"""


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


def gcdList(ls):
    return reduce(gcd, ls)


n, y = list(map(int, input().split()))
x = sorted([int(i) for i in input().split()])
x_ = [0 for _ in range(n)]
for i in range(n):
    x_[i] = abs(y - x[i])
print((gcdList(x_)))

from fractions import gcd

n, X = list(map(int, input().split()))
x = list(map(int, input().split()))
a = []
for i in range(n):
    a.append(abs(X - x[i]))
if n > 1:
    b = gcd(a[0], a[1])
else:
    b = a[0]
for i in range(n):
    b = gcd(b, a[i])
print(b)

-# import math -# import fractions -from functools import reduce +from fractions import gcd -""" -def gcdList(ls): -    return reduce(math.gcd, ls) -#    return reduce(fractions.gcd, ls) -""" - - -def gcd(a, b): -    while b: -        a, b = b, a % b -    return a - - -def gcdList(ls): -    return reduce(gcd, ls) - - -n, y = list(map(int, input().split())) -x = sorted([int(i) for i in input().split()]) -x_ = [0 for _ in range(n)] +n, X = list(map(int, input().split())) +x = list(map(int, input().split())) +a = [] -    x_[i] = abs(y - x[i]) -print((gcdList(x_))) +    a.append(abs(X - x[i])) +if n > 1: +    b = gcd(a[0], a[1]) +else: +    b = a[0] +for i in range(n): +    b = gcd(b, a[i]) +print(b)