def gcd(a,b):

    if b == 0:

        return a

    return gcd(b,a%b)



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

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

x.append(S)

x = sorted(x)

t = x[1]-x[0]



for k in range(N):

    t = gcd(t,x[k+1]-x[k])



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

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



def gcd(a,b):

    if b == 0:

        return a

    return gcd(b,a%b)

ans = abs(X-x[0])



for k in range(1,N):

    ans = gcd(ans,abs(x[k]-x[k-1]))

print(ans)

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


N, S = list(map(int, input().split()))
x = list(map(int, input().split()))
x.append(S)
x = sorted(x)
t = x[1] - x[0]
for k in range(N):
    t = gcd(t, x[k + 1] - x[k])
print(t)

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


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


ans = abs(X - x[0])
for k in range(1, N):
    ans = gcd(ans, abs(x[k] - x[k - 1]))
print(ans)

+N, X = list(map(int, input().split())) +x = list(map(int, input().split())) + + -N, S = list(map(int, input().split())) -x = list(map(int, input().split())) -x.append(S) -x = sorted(x) -t = x[1] - x[0] -for k in range(N): -    t = gcd(t, x[k + 1] - x[k]) -print(t) +ans = abs(X - x[0]) +for k in range(1, N): +    ans = gcd(ans, abs(x[k] - x[k - 1])) +print(ans)