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

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

a.append(x)

a.sort(reverse=True)

b=[]

for i in range(n):

    b.append(a[i]-a[i+1])

import fractions as f

maxi=float('inf')

if len(b)==1:

    print((b[0]))

    exit()

for i in range(n-1):

    tmp=f.gcd(b[i],b[i+1])

    maxi=min(maxi,tmp)

print(maxi)

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

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

a.append(x)

a=sorted(a)

distance=[0]*n

for i in range(n):

    distance[i]=a[i+1]-a[i]

tmp=0

import fractions

for i in range(n):

    tmp=fractions.gcd(distance[i],tmp)

print(tmp)

    
n, x = list(map(int, input().split()))
a = list(map(int, input().split()))
a.append(x)
a.sort(reverse=True)
b = []
for i in range(n):
    b.append(a[i] - a[i + 1])
import fractions as f

maxi = float("inf")
if len(b) == 1:
    print((b[0]))
    exit()
for i in range(n - 1):
    tmp = f.gcd(b[i], b[i + 1])
    maxi = min(maxi, tmp)
print(maxi)

n, x = list(map(int, input().split()))
a = list(map(int, input().split()))
a.append(x)
a = sorted(a)
distance = [0] * n
for i in range(n):
    distance[i] = a[i + 1] - a[i]
tmp = 0
import fractions

for i in range(n):
    tmp = fractions.gcd(distance[i], tmp)
print(tmp)

-a.sort(reverse=True) -b = [] +a = sorted(a) +distance = [0] * n -    b.append(a[i] - a[i + 1]) -import fractions as f +    distance[i] = a[i + 1] - a[i] +tmp = 0 +import fractions -maxi = float("inf") -if len(b) == 1: -    print((b[0])) -    exit() -for i in range(n - 1): -    tmp = f.gcd(b[i], b[i + 1]) -    maxi = min(maxi, tmp) -print(maxi) +for i in range(n): +    tmp = fractions.gcd(distance[i], tmp) +print(tmp)