import numpy as np



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

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

x = np.abs(X - x)



for i in range(N-1):

    a, b = x[i:i+2]

    while b > 0:

        a, b = b, a % b

    x[i+1] = a



print((x[-1]))

#import math

import fractions as math



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

x = sorted([X] + list(map(int, input().split())))

nums = [-(x[i]-x[i+1]) for i in range(N)]

ans = 0

for n in nums:

    ans = math.gcd(ans, n)

print(ans)
import numpy as np

N, X = list(map(int, input().split()))
x = np.array(list(map(int, input().split())))
x = np.abs(X - x)
for i in range(N - 1):
    a, b = x[i : i + 2]
    while b > 0:
        a, b = b, a % b
    x[i + 1] = a
print((x[-1]))

# import math
import fractions as math

N, X = list(map(int, input().split()))
x = sorted([X] + list(map(int, input().split())))
nums = [-(x[i] - x[i + 1]) for i in range(N)]
ans = 0
for n in nums:
    ans = math.gcd(ans, n)
print(ans)

-import numpy as np +# import math +import fractions as math -x = np.array(list(map(int, input().split()))) -x = np.abs(X - x) -for i in range(N - 1): -    a, b = x[i : i + 2] -    while b > 0: -        a, b = b, a % b -    x[i + 1] = a -print((x[-1])) +x = sorted([X] + list(map(int, input().split()))) +nums = [-(x[i] - x[i + 1]) for i in range(N)] +ans = 0 +for n in nums: +    ans = math.gcd(ans, n) +print(ans)