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

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



m = []

for aa in a:

  m.append(abs(X-aa))



ans = 0

import fractions

for i, g in enumerate(m):

  ans = fractions.gcd(ans, g)

  

print(ans)
def main():

  n,m = input_list()

  x = input_list()

  if len(x) == 1:

    print((abs(x[0] - m)))

    exit(0)

  diffs = []

  for i in range(len(x)):

    d = abs(m - x[i])

    diffs.append(d)

  print((gcd_list(diffs)))

  

def input_list():

  return list(map(int, input().split()))



def input_list_str():

  return list(map(str, input().split()))



def lcm_base(x, y):

    return (x * y) // fractions.gcd(x, y)



def lcm_list(numbers):

    return reduce(lcm_base, numbers, 1)



def gcd(*numbers):

    return reduce(fractions.gcd, numbers)



def gcd_list(numbers):

    return reduce(fractions.gcd, numbers)



# 2で割り切れる回数

def divide_two(arg):

  c = 0

  while True:

    if c >= 2:

      break

    if arg % 2 != 0:

      break

    arg //= 2

    c += 1

  return c 



import math

import fractions

import collections

from functools import reduce

main()
N, X = list(map(int, input().split()))
a = list(map(int, input().split()))
m = []
for aa in a:
    m.append(abs(X - aa))
ans = 0
import fractions

for i, g in enumerate(m):
    ans = fractions.gcd(ans, g)
print(ans)

def main():
    n, m = input_list()
    x = input_list()
    if len(x) == 1:
        print((abs(x[0] - m)))
        exit(0)
    diffs = []
    for i in range(len(x)):
        d = abs(m - x[i])
        diffs.append(d)
    print((gcd_list(diffs)))


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


def input_list_str():
    return list(map(str, input().split()))


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


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


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


# 2で割り切れる回数
def divide_two(arg):
    c = 0
    while True:
        if c >= 2:
            break
        if arg % 2 != 0:
            break
        arg //= 2
        c += 1
    return c


import math
import fractions
import collections
from functools import reduce

main()

-N, X = list(map(int, input().split())) -a = list(map(int, input().split())) -m = [] -for aa in a: -    m.append(abs(X - aa)) -ans = 0 +def main(): +    n, m = input_list() +    x = input_list() +    if len(x) == 1: +        print((abs(x[0] - m))) +        exit(0) +    diffs = [] +    for i in range(len(x)): +        d = abs(m - x[i]) +        diffs.append(d) +    print((gcd_list(diffs))) + + +def input_list(): +    return list(map(int, input().split())) + + +def input_list_str(): +    return list(map(str, input().split())) + + +def lcm_base(x, y): +    return (x * y) // fractions.gcd(x, y) + + +def lcm_list(numbers): +    return reduce(lcm_base, numbers, 1) + + +def gcd(*numbers): +    return reduce(fractions.gcd, numbers) + + +def gcd_list(numbers): +    return reduce(fractions.gcd, numbers) + + +# 2で割り切れる回数 +def divide_two(arg): +    c = 0 +    while True: +        if c >= 2: +            break +        if arg % 2 != 0: +            break +        arg //= 2 +        c += 1 +    return c + + +import math +import collections +from functools import reduce -for i, g in enumerate(m): -    ans = fractions.gcd(ans, g) -print(ans) +main()