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

r = {abs(X-i) for i in map(int, input().split())}

ans = r.pop()

for i in r:

    while ans%i != 0:

        ans,i = i,ans%i

    ans = i

print(ans)
def solve():

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

    r = [abs(X-i) for i in map(int, input().split())]

    ans = r.pop()

    for i in r:

        while ans%i != 0:

            ans,i = i,ans%i

        ans = i

    return ans



if __name__ == '__main__':

    print((solve()))
N, X = list(map(int, input().split()))
r = {abs(X - i) for i in map(int, input().split())}
ans = r.pop()
for i in r:
    while ans % i != 0:
        ans, i = i, ans % i
    ans = i
print(ans)

def solve():
    N, X = list(map(int, input().split()))
    r = [abs(X - i) for i in map(int, input().split())]
    ans = r.pop()
    for i in r:
        while ans % i != 0:
            ans, i = i, ans % i
        ans = i
    return ans


if __name__ == "__main__":
    print((solve()))

-N, X = list(map(int, input().split())) -r = {abs(X - i) for i in map(int, input().split())} -ans = r.pop() -for i in r: -    while ans % i != 0: -        ans, i = i, ans % i -    ans = i -print(ans) +def solve(): +    N, X = list(map(int, input().split())) +    r = [abs(X - i) for i in map(int, input().split())] +    ans = r.pop() +    for i in r: +        while ans % i != 0: +            ans, i = i, ans % i +        ans = i +    return ans + + +if __name__ == "__main__": +    print((solve()))