from fractions import gcd





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

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

ans = 0

for i in range(N):

    ans = gcd(ans, abs(X[i + 1] - X[i]))

print(ans)

from fractions import gcd

from functools import reduce



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

print((reduce(gcd, (abs(X - i) for i in map(int, input().split())))))

from fractions import gcd

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

from fractions import gcd
from functools import reduce

_, X = list(map(int, input().split()))
print((reduce(gcd, (abs(X - i) for i in map(int, input().split())))))

+from functools import reduce -N, X = list(map(int, input().split())) -X = [X] + list(map(int, input().split())) -ans = 0 -for i in range(N): -    ans = gcd(ans, abs(X[i + 1] - X[i])) -print(ans) +_, X = list(map(int, input().split())) +print((reduce(gcd, (abs(X - i) for i in map(int, input().split())))))