from fractions import gcd

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

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

l = [abs(i-x) for i in l]

res = l[0]

for i in range(1,n):

    res = gcd(res,l[i])

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

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

a = [abs(i-x) for i in xl]

def gcd(x,y):

    if x<y:

        x,y = y,x

    if y==0:

        return x

    if x%y==0:

        return y

    else:

        return gcd(y,x%y)

ans = a[0]

for i in a:

    ans = gcd(ans,i)

print(ans)
from fractions import gcd

n, x = list(map(int, input().split()))
l = list(map(int, input().split()))
l = [abs(i - x) for i in l]
res = l[0]
for i in range(1, n):
    res = gcd(res, l[i])
print(res)

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


def gcd(x, y):
    if x < y:
        x, y = y, x
    if y == 0:
        return x
    if x % y == 0:
        return y
    else:
        return gcd(y, x % y)


ans = a[0]
for i in a:
    ans = gcd(ans, i)
print(ans)

-from fractions import gcd +n, x = list(map(int, input().split())) +xl = list(map(int, input().split())) +a = [abs(i - x) for i in xl] -n, x = list(map(int, input().split())) -l = list(map(int, input().split())) -l = [abs(i - x) for i in l] -res = l[0] -for i in range(1, n): -    res = gcd(res, l[i]) -print(res) + +def gcd(x, y): +    if x < y: +        x, y = y, x +    if y == 0: +        return x +    if x % y == 0: +        return y +    else: +        return gcd(y, x % y) + + +ans = a[0] +for i in a: +    ans = gcd(ans, i) +print(ans)