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

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



def gcd(x, y):

    while (y != 0):

        x, y = y, x%y



    return x



diff = []



for j in l:

    diff.append(abs(j - x))



ans = diff[0]



for d in diff[1:]:

    ans = gcd(ans, d)



print(ans)







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

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



def gcd(x, y):

    while (y != 0):

        x, y = y, x%y



    return x



ans = abs(l[0] - x)



for d in l[1:]:

    ans = gcd(ans, abs(d - x))



print(ans)

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


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


diff = []
for j in l:
    diff.append(abs(j - x))
ans = diff[0]
for d in diff[1:]:
    ans = gcd(ans, d)
print(ans)

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


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


ans = abs(l[0] - x)
for d in l[1:]:
    ans = gcd(ans, abs(d - x))
print(ans)

-diff = [] -for j in l: -    diff.append(abs(j - x)) -ans = diff[0] -for d in diff[1:]: -    ans = gcd(ans, d) +ans = abs(l[0] - x) +for d in l[1:]: +    ans = gcd(ans, abs(d - x))