import fractions

from functools import reduce



def gcd_list(numbers):

    return reduce(fractions.gcd, numbers)



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

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

ans=[]

for i in W:

    ans.append(abs(i-X))



print((gcd_list(ans)))

import fractions

from functools import reduce



def gcd_list(numbers):

    return reduce(fractions.gcd, numbers)



def myAnswer(N:int,X:int,x:list) -> int:

   ans = []

   for a in x:

      ans.append(abs(a-X))

   return gcd_list(ans)



def modelAnswer():

   return

def main():

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

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

   print((myAnswer(N,X,x[:])))

if __name__ == '__main__':

   main()





import fractions
from functools import reduce


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


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

import fractions
from functools import reduce


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


def myAnswer(N: int, X: int, x: list) -> int:
    ans = []
    for a in x:
        ans.append(abs(a - X))
    return gcd_list(ans)


def modelAnswer():
    return


def main():
    N, X = list(map(int, input().split()))
    x = list(map(int, input().split()))
    print((myAnswer(N, X, x[:])))


if __name__ == "__main__":
    main()

-N, X = list(map(int, input().split())) -W = list(map(int, input().split())) -ans = [] -for i in W: -    ans.append(abs(i - X)) -print((gcd_list(ans))) +def myAnswer(N: int, X: int, x: list) -> int: +    ans = [] +    for a in x: +        ans.append(abs(a - X)) +    return gcd_list(ans) + + +def modelAnswer(): +    return + + +def main(): +    N, X = list(map(int, input().split())) +    x = list(map(int, input().split())) +    print((myAnswer(N, X, x[:]))) + + +if __name__ == "__main__": +    main()