from functools import reduce



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

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

for i in range(n):

    x[i] -= X

    x[i] = abs(x[i])



def gcd(a, b):

    if b == 0:

        return a

    return gcd(b, a % b)



def gcd_list(n):

    return reduce(gcd, n)



print((gcd_list(x)))
from functools import reduce



def gcd(a, b):

    if b == 0:

        return a

    return gcd(b, a % b)



def gcd_list(n):

    return reduce(gcd, n)



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

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

dx = [abs(X - i) for i in x]

print((gcd_list(dx)))
from functools import reduce

n, X = list(map(int, input().split()))
x = list(map(int, input().split()))
for i in range(n):
    x[i] -= X
    x[i] = abs(x[i])


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


def gcd_list(n):
    return reduce(gcd, n)


print((gcd_list(x)))

from functools import reduce


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


def gcd_list(n):
    return reduce(gcd, n)


n, X = list(map(int, input().split()))
x = list(map(int, input().split()))
dx = [abs(X - i) for i in x]
print((gcd_list(dx)))

- -n, X = list(map(int, input().split())) -x = list(map(int, input().split())) -for i in range(n): -    x[i] -= X -    x[i] = abs(x[i]) -print((gcd_list(x))) +n, X = list(map(int, input().split())) +x = list(map(int, input().split())) +dx = [abs(X - i) for i in x] +print((gcd_list(dx)))