from fractions import gcd



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

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



res = abs(town[0] - x)

for t in town[1:]:

    d = abs(t - x)

    res = gcd(res, d)



print(res)
def gcd(a, b):

    while a > 0:

        if a < b:

            a, b = b, a

        a = a % b

    return b



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

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



res = abs(town[0] - x)

for t in town[1:]:

    d = abs(t - x)

    res = gcd(res, d)



print(res)
from fractions import gcd

n, x = list(map(int, input().split()))
town = list(map(int, input().split()))
res = abs(town[0] - x)
for t in town[1:]:
    d = abs(t - x)
    res = gcd(res, d)
print(res)

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


n, x = list(map(int, input().split()))
town = list(map(int, input().split()))
res = abs(town[0] - x)
for t in town[1:]:
    d = abs(t - x)
    res = gcd(res, d)
print(res)

-from fractions import gcd +def gcd(a, b): +    while a > 0: +        if a < b: +            a, b = b, a +        a = a % b +    return b +