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

li = list(input().split())

li = [abs(int(a)-x) for a in li]



def gcd(a,b):

    while a%b!=0:

        a,b = b,a%b

    return b

    

if n == 1:

    print((abs(li[0])))

    

elif n == 2:

    print((gcd(li[0],li[1])))

    

elif n >= 3:



    c = gcd(li[0],li[1])

    #print(c)

    for i in range(2,len(li)-1):

        c = gcd(c,li[i])

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

li = list(input().split())

li = [abs(int(a)-x) for a in li]



def gcd(a,b):

    while a%b!=0:

        a,b = b,a%b

    return b

    

from functools import reduce



a = reduce(gcd,li)

print(a)
n, x = list(map(int, input().split()))
li = list(input().split())
li = [abs(int(a) - x) for a in li]


def gcd(a, b):
    while a % b != 0:
        a, b = b, a % b
    return b


if n == 1:
    print((abs(li[0])))
elif n == 2:
    print((gcd(li[0], li[1])))
elif n >= 3:
    c = gcd(li[0], li[1])
    # print(c)
    for i in range(2, len(li) - 1):
        c = gcd(c, li[i])
    print(c)

n, x = list(map(int, input().split()))
li = list(input().split())
li = [abs(int(a) - x) for a in li]


def gcd(a, b):
    while a % b != 0:
        a, b = b, a % b
    return b


from functools import reduce

a = reduce(gcd, li)
print(a)

-if n == 1: -    print((abs(li[0]))) -elif n == 2: -    print((gcd(li[0], li[1]))) -elif n >= 3: -    c = gcd(li[0], li[1]) -    # print(c) -    for i in range(2, len(li) - 1): -        c = gcd(c, li[i]) -    print(c) +from functools import reduce + +a = reduce(gcd, li) +print(a)