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

x=[abs(int(i)-X) for i in input().split()]



def gcd(x, y):

    x, y=max(x,y), min(x,y)

    if y==0:

        return x

    else:

        return gcd(y, x%y)



ans=1

for i in range(N):

    if i==0:

        ans=x[i]

    else:

        ans=gcd(ans, x[i])

print(ans)
from itertools import accumulate





def gcd(x, y):

    if y == 0:

        return x

    return gcd(y, x % y)





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

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

B = [abs(a-K) for a in A]



ans = list(accumulate(B, func=gcd))[-1]

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


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


ans = 1
for i in range(N):
    if i == 0:
        ans = x[i]
    else:
        ans = gcd(ans, x[i])
print(ans)

from itertools import accumulate


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


N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = [abs(a - K) for a in A]
ans = list(accumulate(B, func=gcd))[-1]
print(ans)

-N, X = list(map(int, input().split())) -x = [abs(int(i) - X) for i in input().split()] +from itertools import accumulate -    x, y = max(x, y), min(x, y) -    else: -        return gcd(y, x % y) +    return gcd(y, x % y) -ans = 1 -for i in range(N): -    if i == 0: -        ans = x[i] -    else: -        ans = gcd(ans, x[i]) +N, K = list(map(int, input().split())) +A = list(map(int, input().split())) +B = [abs(a - K) for a in A] +ans = list(accumulate(B, func=gcd))[-1]