import numpy as np



def gcd(a,b):

    if a % b == 0:

        return b

    return gcd(b, a%b)





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

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



s = np.array(x)

s = abs(s-X)



if len(s) == 1:

    print((s[0]))

    exit()



for i in range(1, len(s)):

    if i == 1:

        D = gcd(s[i],s[i-1])

    D = gcd(s[i], D)



print(D)

from math import gcd



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

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



aX = list([abs(x-X) for x in xs])



ans = aX[0]

for i in range(1, N):

    ans = gcd(ans, aX[i])

print(ans)

import numpy as np


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


N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
s = np.array(x)
s = abs(s - X)
if len(s) == 1:
    print((s[0]))
    exit()
for i in range(1, len(s)):
    if i == 1:
        D = gcd(s[i], s[i - 1])
    D = gcd(s[i], D)
print(D)

from math import gcd

N, X = list(map(int, input().split()))
xs = list(map(int, input().split()))
aX = list([abs(x - X) for x in xs])
ans = aX[0]
for i in range(1, N):
    ans = gcd(ans, aX[i])
print(ans)

-import numpy as np - - -def gcd(a, b): -    if a % b == 0: -        return b -    return gcd(b, a % b) - +from math import gcd -x = list(map(int, input().split())) -s = np.array(x) -s = abs(s - X) -if len(s) == 1: -    print((s[0])) -    exit() -for i in range(1, len(s)): -    if i == 1: -        D = gcd(s[i], s[i - 1]) -    D = gcd(s[i], D) -print(D) +xs = list(map(int, input().split())) +aX = list([abs(x - X) for x in xs]) +ans = aX[0] +for i in range(1, N): +    ans = gcd(ans, aX[i]) +print(ans)