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

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



def gcd(m, n):

  while n:

    m, n = n, m%n

  return m

tmp = [abs(X-xx) for xx in x]

ans = tmp[0]

for i in range(1,N):

  ans = gcd(ans, tmp[i])

print(ans)
def gcd(m, n):

  while n:

    m, n = n, m%n

  return m



def ans():

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

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

  xx = [abs(X-n) for n in x]

  res = xx[0]

  for i in range(1,N):

    res = gcd(res, xx[i])

  print(res)

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


def gcd(m, n):
    while n:
        m, n = n, m % n
    return m


tmp = [abs(X - xx) for xx in x]
ans = tmp[0]
for i in range(1, N):
    ans = gcd(ans, tmp[i])
print(ans)

def gcd(m, n):
    while n:
        m, n = n, m % n
    return m


def ans():
    N, X = list(map(int, input().split()))
    x = list(map(int, input().split()))
    xx = [abs(X - n) for n in x]
    res = xx[0]
    for i in range(1, N):
        res = gcd(res, xx[i])
    print(res)


ans()

-N, X = list(map(int, input().split())) -x = list(map(int, input().split())) - - -tmp = [abs(X - xx) for xx in x] -ans = tmp[0] -for i in range(1, N): -    ans = gcd(ans, tmp[i]) -print(ans) +def ans(): +    N, X = list(map(int, input().split())) +    x = list(map(int, input().split())) +    xx = [abs(X - n) for n in x] +    res = xx[0] +    for i in range(1, N): +        res = gcd(res, xx[i]) +    print(res) + + +ans()