import numpy as np

from functools import reduce

from fractions import gcd





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



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



distances = abs(places - X)



answer = reduce(gcd, distances)

print(answer)
# coding: utf-8

import sys

import numpy as np

from fractions import gcd



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N, X0 = lr()

X = np.array(lr())

Xdiff = np.abs((X-X0)).tolist()

g = Xdiff[0]

for i in range(1, N):

    g = gcd(g, Xdiff[i])



answer = g

print(answer)

import numpy as np
from functools import reduce
from fractions import gcd

N, X = list(map(int, input().split()))
places = np.array(list(map(int, input().split())))
distances = abs(places - X)
answer = reduce(gcd, distances)
print(answer)

# coding: utf-8
import sys
import numpy as np
from fractions import gcd

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N, X0 = lr()
X = np.array(lr())
Xdiff = np.abs((X - X0)).tolist()
g = Xdiff[0]
for i in range(1, N):
    g = gcd(g, Xdiff[i])
answer = g
print(answer)

+# coding: utf-8 +import sys -from functools import reduce -N, X = list(map(int, input().split())) -places = np.array(list(map(int, input().split()))) -distances = abs(places - X) -answer = reduce(gcd, distances) +sr = lambda: sys.stdin.readline().rstrip() +ir = lambda: int(sr()) +lr = lambda: list(map(int, sr().split())) +N, X0 = lr() +X = np.array(lr()) +Xdiff = np.abs((X - X0)).tolist() +g = Xdiff[0] +for i in range(1, N): +    g = gcd(g, Xdiff[i]) +answer = g