import fractions

from functools import reduce

gcd = lambda l: reduce(fractions.gcd, l)

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

c = [abs(x-int(i)) for i in input().split()]

print((gcd(c)))
import math

from functools import reduce

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

x = [abs(X-i) for i in map(int, input().split())]

print((reduce(math.gcd, x)))
import fractions
from functools import reduce

gcd = lambda l: reduce(fractions.gcd, l)
n, x = list(map(int, input().split()))
c = [abs(x - int(i)) for i in input().split()]
print((gcd(c)))

import math
from functools import reduce

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

-import fractions +import math -gcd = lambda l: reduce(fractions.gcd, l) -n, x = list(map(int, input().split())) -c = [abs(x - int(i)) for i in input().split()] -print((gcd(c))) +N, X = list(map(int, input().split())) +x = [abs(X - i) for i in map(int, input().split())] +print((reduce(math.gcd, x)))