import math

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

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

L = ([abs(x-A) for x in X])

S = L[0]

for i in range(1, N):

  S = math.gcd(S,L[i])

print(S)
import math

from functools import reduce

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

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

L = ([abs(x-A) for x in X])

print((reduce(math.gcd, L)))
import math

N, A = list(map(int, input().split()))
X = list(map(int, input().split()))
L = [abs(x - A) for x in X]
S = L[0]
for i in range(1, N):
    S = math.gcd(S, L[i])
print(S)

import math
from functools import reduce

N, A = list(map(int, input().split()))
X = list(map(int, input().split()))
L = [abs(x - A) for x in X]
print((reduce(math.gcd, L)))

+from functools import reduce -S = L[0] -for i in range(1, N): -    S = math.gcd(S, L[i]) -print(S) +print((reduce(math.gcd, L)))