import math

import numpy as np

def yakusu(num):

    top = []

    bot = []

    for i in range(int(math.sqrt(num))):

        k = i+1

        if num%k == 0:

            top.append(num//k)

            bot.append(k)

    return top + bot[::-1]



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

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

x.append(X)

x.sort()

start = x[0]

x = np.array(x[1:])

x -= start

# print(x)



for ans_pred in yakusu(x[0]):

    if ans_pred == 1:

        break

    flag = True

    for i in x:

        if i % ans_pred != 0:

            flag= False

            break

    if flag:

        break



print(ans_pred)
from fractions import gcd



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

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



ans = None

for i in xi:

    distance = abs(i-x)

    if ans is None:

        ans = distance

    else:

        ans = gcd(ans, distance)

print(ans)
import math
import numpy as np


def yakusu(num):
    top = []
    bot = []
    for i in range(int(math.sqrt(num))):
        k = i + 1
        if num % k == 0:
            top.append(num // k)
            bot.append(k)
    return top + bot[::-1]


n, X = list(map(int, input().split()))
x = list(map(int, input().split()))
x.append(X)
x.sort()
start = x[0]
x = np.array(x[1:])
x -= start
# print(x)
for ans_pred in yakusu(x[0]):
    if ans_pred == 1:
        break
    flag = True
    for i in x:
        if i % ans_pred != 0:
            flag = False
            break
    if flag:
        break
print(ans_pred)

from fractions import gcd

n, x = list(map(int, input().split()))
xi = list(map(int, input().split()))
ans = None
for i in xi:
    distance = abs(i - x)
    if ans is None:
        ans = distance
    else:
        ans = gcd(ans, distance)
print(ans)

-import math -import numpy as np +from fractions import gcd - -def yakusu(num): -    top = [] -    bot = [] -    for i in range(int(math.sqrt(num))): -        k = i + 1 -        if num % k == 0: -            top.append(num // k) -            bot.append(k) -    return top + bot[::-1] - - -n, X = list(map(int, input().split())) -x = list(map(int, input().split())) -x.append(X) -x.sort() -start = x[0] -x = np.array(x[1:]) -x -= start -# print(x) -for ans_pred in yakusu(x[0]): -    if ans_pred == 1: -        break -    flag = True -    for i in x: -        if i % ans_pred != 0: -            flag = False -            break -    if flag: -        break -print(ans_pred) +n, x = list(map(int, input().split())) +xi = list(map(int, input().split())) +ans = None +for i in xi: +    distance = abs(i - x) +    if ans is None: +        ans = distance +    else: +        ans = gcd(ans, distance) +print(ans)