from functools import reduce

from math import gcd

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

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

b = []

for ai in a:

    b.append(abs(ai-x))

print((reduce(gcd,b)))
from functools import reduce

from math import gcd

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

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

print((reduce(gcd,(abs(ai-x) for ai in a))))
from functools import reduce
from math import gcd

n, x = list(map(int, input().split()))
a = list(map(int, input().split()))
b = []
for ai in a:
    b.append(abs(ai - x))
print((reduce(gcd, b)))

from functools import reduce
from math import gcd

n, x = list(map(int, input().split()))
a = list(map(int, input().split()))
print((reduce(gcd, (abs(ai - x) for ai in a))))

-b = [] -for ai in a: -    b.append(abs(ai - x)) -print((reduce(gcd, b))) +print((reduce(gcd, (abs(ai - x) for ai in a))))