from math import gcd

from functools import reduce



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

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

x.add(X)

x = sorted(x)

print((reduce(gcd, (j - i for i, j in zip(x[:-1], x[1:])))))
from math import gcd

from functools import reduce



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

print((reduce(gcd, (abs(i - X) for i in set(map(int, input().split()))))))
from math import gcd
from functools import reduce

_, X = list(map(int, input().split()))
x = set(map(int, input().split()))
x.add(X)
x = sorted(x)
print((reduce(gcd, (j - i for i, j in zip(x[:-1], x[1:])))))

from math import gcd
from functools import reduce

_, X = list(map(int, input().split()))
print((reduce(gcd, (abs(i - X) for i in set(map(int, input().split()))))))

-x = set(map(int, input().split())) -x.add(X) -x = sorted(x) -print((reduce(gcd, (j - i for i, j in zip(x[:-1], x[1:]))))) +print((reduce(gcd, (abs(i - X) for i in set(map(int, input().split()))))))