import fractions

from functools import reduce

def gcd_list(l):

    return reduce(fractions.gcd, l)

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

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

X = [abs(x - x0) for x in X]

print((gcd_list(X)))
from functools import reduce

import math

def main():

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

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

    ans = reduce(lambda x, y :math.gcd(x, y), X, X[0])

    print(ans)



if __name__ == '__main__':

    main()

import fractions
from functools import reduce


def gcd_list(l):
    return reduce(fractions.gcd, l)


n, x0 = list(map(int, input().split()))
X = list(map(int, input().split()))
X = [abs(x - x0) for x in X]
print((gcd_list(X)))

from functools import reduce
import math


def main():
    n, s = list(map(int, input().split()))
    X = list([abs(int(x) - s) for x in input().split()])
    ans = reduce(lambda x, y: math.gcd(x, y), X, X[0])
    print(ans)


if __name__ == "__main__":
    main()

-import fractions +import math -def gcd_list(l): -    return reduce(fractions.gcd, l) +def main(): +    n, s = list(map(int, input().split())) +    X = list([abs(int(x) - s) for x in input().split()]) +    ans = reduce(lambda x, y: math.gcd(x, y), X, X[0]) +    print(ans) -n, x0 = list(map(int, input().split())) -X = list(map(int, input().split())) -X = [abs(x - x0) for x in X] -print((gcd_list(X))) +if __name__ == "__main__": +    main()