# coding:utf-8



from fractions import gcd 



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



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



if n == 1:

    d = dist_list[0]

else:

    d = gcd(dist_list[1], dist_list[0])

    for i in range(n-2):

        d = gcd(d, dist_list[i+1])



print(d)

# coding:utf-8



from fractions import gcd

from functools import reduce



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



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



d = reduce(gcd, dist_list)



print(d)

# coding:utf-8
from fractions import gcd

n, y = list(map(int, input().split()))
dist_list = [abs(x - y) for x in map(int, input().split())]
if n == 1:
    d = dist_list[0]
else:
    d = gcd(dist_list[1], dist_list[0])
    for i in range(n - 2):
        d = gcd(d, dist_list[i + 1])
print(d)

# coding:utf-8
from fractions import gcd
from functools import reduce

n, y = list(map(int, input().split()))
dist_list = [abs(x - y) for x in map(int, input().split())]
d = reduce(gcd, dist_list)
print(d)

+from functools import reduce -if n == 1: -    d = dist_list[0] -else: -    d = gcd(dist_list[1], dist_list[0]) -    for i in range(n - 2): -        d = gcd(d, dist_list[i + 1]) +d = reduce(gcd, dist_list)