import numpy as np

import fractions



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

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

result = abs(abs(np.array(x))-X)



D= result[0]

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

    D=fractions.gcd(D,result[i])

print(D)

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

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



import numpy as np

X_abs = abs(np.array(x)-X)

#最大公約数、最小公倍数

import fractions



gcd = X_abs[0]

for  i in range (1,N):

    gcd = fractions.gcd(gcd,X_abs[i])

    

print(gcd)
import numpy as np
import fractions

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

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
import numpy as np

X_abs = abs(np.array(x) - X)
# 最大公約数、最小公倍数
import fractions

gcd = X_abs[0]
for i in range(1, N):
    gcd = fractions.gcd(gcd, X_abs[i])
print(gcd)

+N, X = list(map(int, input().split())) +x = list(map(int, input().split())) + +X_abs = abs(np.array(x) - X) +# 最大公約数、最小公倍数 -N, X = list(map(int, input().split())) -x = list(map(int, input().split())) -result = abs(abs(np.array(x)) - X) -D = result[0] -for i in range(1, len(result)): -    D = fractions.gcd(D, result[i]) -print(D) +gcd = X_abs[0] +for i in range(1, N): +    gcd = fractions.gcd(gcd, X_abs[i]) +print(gcd)