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

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



d = [abs(e - X) for e in x]



import fractions

g=0

for e in d:

  g=fractions.gcd(e,g)

print(g)

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

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



d = [abs(e - X) for e in x]



import fractions

from functools import reduce

# g=0

# for e in d:

#   g=fractions.gcd(e,g)

# print(g)



print((reduce(fractions.gcd, d)))

n, X = list(map(int, input().split()))
x = list(map(int, input().split()))
d = [abs(e - X) for e in x]
import fractions

g = 0
for e in d:
    g = fractions.gcd(e, g)
print(g)

n, X = list(map(int, input().split()))
x = list(map(int, input().split()))
d = [abs(e - X) for e in x]
import fractions
from functools import reduce

# g=0
# for e in d:
#   g=fractions.gcd(e,g)
# print(g)
print((reduce(fractions.gcd, d)))

+from functools import reduce -g = 0 -for e in d: -    g = fractions.gcd(e, g) -print(g) +# g=0 +# for e in d: +#   g=fractions.gcd(e,g) +# print(g) +print((reduce(fractions.gcd, d)))