# -*- coding: utf-8 -*-

import fractions

import numpy as np

 

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

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

x.append(X)

x.sort()

 

x=np.array(x)

 

y=x[1:]-x[:-1]

 

y.sort()

y=list(set(y))

z=y[0]

m=len(y)

i=0

while i < m:

    z=fractions.gcd(z,y[i])

    i+=1

 

print(z)
# -*- coding: utf-8 -*-

import fractions

 

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

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

x.append(X)

x.sort()

y=[]

 

i=0

while i < n:

    y.append(x[i+1]-x[i])

    i +=1

y.sort()

 

y=list(set(y))

m=len(y)

z=y[0]

i=0

while i < m:

    z=fractions.gcd(z,y[i])

    i+=1

 

print(z)
# -*- coding: utf-8 -*-
import fractions
import numpy as np

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
x.append(X)
x.sort()
x = np.array(x)
y = x[1:] - x[:-1]
y.sort()
y = list(set(y))
z = y[0]
m = len(y)
i = 0
while i < m:
    z = fractions.gcd(z, y[i])
    i += 1
print(z)

# -*- coding: utf-8 -*-
import fractions

n, X = list(map(int, input().split()))
x = list(map(int, input().split()))
x.append(X)
x.sort()
y = []
i = 0
while i < n:
    y.append(x[i + 1] - x[i])
    i += 1
y.sort()
y = list(set(y))
m = len(y)
z = y[0]
i = 0
while i < m:
    z = fractions.gcd(z, y[i])
    i += 1
print(z)

-import numpy as np -N, X = list(map(int, input().split())) +n, X = list(map(int, input().split())) -x = np.array(x) -y = x[1:] - x[:-1] +y = [] +i = 0 +while i < n: +    y.append(x[i + 1] - x[i]) +    i += 1 +m = len(y) -m = len(y)