from functools import reduce

import numpy as np



def gcd(a, b):

    if b > 0:

        return gcd(b, a%b)

    else:

        return a



def gcd_list(arg_list):

    return reduce(gcd, arg_list)



N, X = tuple(map(int, input().split(" ")))

Xs = [X] + list(map(int, input().split(" ")))

Xs = list(map(abs, np.diff(Xs)))

r = gcd_list(Xs)

print(r)

from functools import *

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

xs = list(map(int, input().split(" ")))

xs = list([X-x if X>x else x-X for x in xs])

def gcd(a, b):

    if b == 0:

        return a

    return gcd(b, a%b) 

r = reduce(gcd, xs)

print(r)

from functools import reduce
import numpy as np


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


def gcd_list(arg_list):
    return reduce(gcd, arg_list)


N, X = tuple(map(int, input().split(" ")))
Xs = [X] + list(map(int, input().split(" ")))
Xs = list(map(abs, np.diff(Xs)))
r = gcd_list(Xs)
print(r)

from functools import *

N, X = list(map(int, input().split(" ")))
xs = list(map(int, input().split(" ")))
xs = list([X - x if X > x else x - X for x in xs])


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


r = reduce(gcd, xs)
print(r)

-from functools import reduce -import numpy as np +from functools import * + +N, X = list(map(int, input().split(" "))) +xs = list(map(int, input().split(" "))) +xs = list([X - x if X > x else x - X for x in xs]) -    if b > 0: -        return gcd(b, a % b) -    else: +    if b == 0: +    return gcd(b, a % b) -def gcd_list(arg_list): -    return reduce(gcd, arg_list) - - -N, X = tuple(map(int, input().split(" "))) -Xs = [X] + list(map(int, input().split(" "))) -Xs = list(map(abs, np.diff(Xs))) -r = gcd_list(Xs) +r = reduce(gcd, xs)