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

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

x.append(X)

x=sorted(x)

dif=[0]*(len(x)-1)

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

  dif[i]=x[i+1]-x[i]



def gcd(a,b):

  if b>a:

    a,b=b,a

  while True:

    if a%b==0:

      return b

    else:

      a,b=b,a%b



ans=dif[0]

for i in range(1,len(dif)):

  ans=gcd(ans,dif[i])



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

p=sorted(list(map(int,input().split())))

def gcd(a,b):

  if a<b:

    a,b=b,a

  while a%b>0:

    a,b=b,a%b

  return b

ans=abs(x-p[0])

for i in range(1,n):

  ans=gcd(ans,p[i]-p[i-1])

  

print(ans)
N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
x.append(X)
x = sorted(x)
dif = [0] * (len(x) - 1)
for i in range(len(x) - 1):
    dif[i] = x[i + 1] - x[i]


def gcd(a, b):
    if b > a:
        a, b = b, a
    while True:
        if a % b == 0:
            return b
        else:
            a, b = b, a % b


ans = dif[0]
for i in range(1, len(dif)):
    ans = gcd(ans, dif[i])
print(ans)

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


def gcd(a, b):
    if a < b:
        a, b = b, a
    while a % b > 0:
        a, b = b, a % b
    return b


ans = abs(x - p[0])
for i in range(1, n):
    ans = gcd(ans, p[i] - p[i - 1])
print(ans)

-N, X = list(map(int, input().split())) -x = list(map(int, input().split())) -x.append(X) -x = sorted(x) -dif = [0] * (len(x) - 1) -for i in range(len(x) - 1): -    dif[i] = x[i + 1] - x[i] +n, x = list(map(int, input().split())) +p = sorted(list(map(int, input().split()))) -    if b > a: +    if a < b: -    while True: -        if a % b == 0: -            return b -        else: -            a, b = b, a % b +    while a % b > 0: +        a, b = b, a % b +    return b -ans = dif[0] -for i in range(1, len(dif)): -    ans = gcd(ans, dif[i]) +ans = abs(x - p[0]) +for i in range(1, n): +    ans = gcd(ans, p[i] - p[i - 1])