import fractions

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

if n==1:

  print((abs(x-int(eval(input())))))

  exit()

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

l.append(x)

l.sort()

l2=[]

for i in range(1,n+1):

  l2.append(l[i]-l[i-1])

a=10000000000

for i in range(len(l2)-1):

  b=fractions.gcd(l2[i],l2[i+1])

  if b<a:

    a=b

print(a)

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time



sys.setrecursionlimit(10**7)

inf=10**20

mod=10**9+7



def LI(): return list(map(int,input().split()))

def I(): return int(eval(input()))

def LS(): return input().split()

def S(): return eval(input())



# GCD

def gcd(x,y):

  while y:

    x,y=y,x%y

  return x



def main():

  n,x=LI()

  l=LI()



  b=abs(l[0]-x)

  for a in l[1:]:

    b=gcd(b,abs(a-x))



  return b



print((main()))

import fractions

n, x = list(map(int, input().split()))
if n == 1:
    print((abs(x - int(eval(input())))))
    exit()
l = list(map(int, input().split()))
l.append(x)
l.sort()
l2 = []
for i in range(1, n + 1):
    l2.append(l[i] - l[i - 1])
a = 10000000000
for i in range(len(l2) - 1):
    b = fractions.gcd(l2[i], l2[i + 1])
    if b < a:
        a = b
print(a)

import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7


def LI():
    return list(map(int, input().split()))


def I():
    return int(eval(input()))


def LS():
    return input().split()


def S():
    return eval(input())


# GCD
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x


def main():
    n, x = LI()
    l = LI()
    b = abs(l[0] - x)
    for a in l[1:]:
        b = gcd(b, abs(a - x))
    return b


print((main()))

-import fractions +import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time -n, x = list(map(int, input().split())) -if n == 1: -    print((abs(x - int(eval(input()))))) -    exit() -l = list(map(int, input().split())) -l.append(x) -l.sort() -l2 = [] -for i in range(1, n + 1): -    l2.append(l[i] - l[i - 1]) -a = 10000000000 -for i in range(len(l2) - 1): -    b = fractions.gcd(l2[i], l2[i + 1]) -    if b < a: -        a = b -print(a) +sys.setrecursionlimit(10**7) +inf = 10**20 +mod = 10**9 + 7 + + +def LI(): +    return list(map(int, input().split())) + + +def I(): +    return int(eval(input())) + + +def LS(): +    return input().split() + + +def S(): +    return eval(input()) + + +# GCD +def gcd(x, y): +    while y: +        x, y = y, x % y +    return x + + +def main(): +    n, x = LI() +    l = LI() +    b = abs(l[0] - x) +    for a in l[1:]: +        b = gcd(b, abs(a - x)) +    return b + + +print((main()))