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

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

X.sort(reverse=True)

D = []



for i in range(len(X)):

    dist = abs(x - X[i])

    D.append(dist)



def gcd(i, j):

    while j != 0:

        i, j = j, i % j

    return i



for i in range(len(D) - 1):

    D[i + 1] = gcd(D[i], D[i + 1])



print((D[-1]))
n, x = list(map(int, input().split()))

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

D = []



for i in range(n):

    dis = abs(x - city[i])

    D.append(dis)

    

def gdc(x, y):

    if x%y == 0:

        return y

    x, y = y, x%y

    return gdc(x, y)



for i in range(n-1):

    D[i + 1] = gdc(D[i], D[i + 1])



print((D[-1]))
n, x = list(map(int, input().split()))
X = list(map(int, input().split()))
X.sort(reverse=True)
D = []
for i in range(len(X)):
    dist = abs(x - X[i])
    D.append(dist)


def gcd(i, j):
    while j != 0:
        i, j = j, i % j
    return i


for i in range(len(D) - 1):
    D[i + 1] = gcd(D[i], D[i + 1])
print((D[-1]))

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


def gdc(x, y):
    if x % y == 0:
        return y
    x, y = y, x % y
    return gdc(x, y)


for i in range(n - 1):
    D[i + 1] = gdc(D[i], D[i + 1])
print((D[-1]))

-X = list(map(int, input().split())) -X.sort(reverse=True) +city = list(map(int, input().split())) -for i in range(len(X)): -    dist = abs(x - X[i]) -    D.append(dist) +for i in range(n): +    dis = abs(x - city[i]) +    D.append(dis) -def gcd(i, j): -    while j != 0: -        i, j = j, i % j -    return i +def gdc(x, y): +    if x % y == 0: +        return y +    x, y = y, x % y +    return gdc(x, y) -for i in range(len(D) - 1): -    D[i + 1] = gcd(D[i], D[i + 1]) +for i in range(n - 1): +    D[i + 1] = gdc(D[i], D[i + 1])