import fractions

from functools import reduce

def gcd_list(numbers):

  return reduce(fractions.gcd, numbers)

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

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

k = []

for i in range(N):

  k.append(abs(A[i]-X))

print((gcd_list(k)))
import math

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

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

ls = []

for i in range(N):

    ls.append(abs(x[i]-X))

now = ls[0]

for i in range(1,N):

    now = math.gcd(ls[i],now)

print(now)
import fractions
from functools import reduce


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


N, X = list(map(int, input().split()))
A = list(map(int, input().split()))
k = []
for i in range(N):
    k.append(abs(A[i] - X))
print((gcd_list(k)))

import math

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
ls = []
for i in range(N):
    ls.append(abs(x[i] - X))
now = ls[0]
for i in range(1, N):
    now = math.gcd(ls[i], now)
print(now)

-import fractions -from functools import reduce - - -def gcd_list(numbers): -    return reduce(fractions.gcd, numbers) - +import math -A = list(map(int, input().split())) -k = [] +x = list(map(int, input().split())) +ls = [] -    k.append(abs(A[i] - X)) -print((gcd_list(k))) +    ls.append(abs(x[i] - X)) +now = ls[0] +for i in range(1, N): +    now = math.gcd(ls[i], now) +print(now)