fun main(args : Array<String>) {
    val (n, x) = readLine()!!.split(" ").map { it.toInt() }
    val xx = readLine()!!.split(" ").map { it.toInt() }.toMutableList()
    xx.add(x)
    xx.sort()

    val diffs = mutableSetOf<Int>()
    for (i in 1..xx.size-1) {
        diffs.add(xx[i]-xx[i-1])
    }

    val sortedDiffs = diffs.toList().sorted()
    val min = diffs.min()!!

    outer@for (i in min downTo 2) {
        for (j in sortedDiffs) {
           if (j % i != 0) continue@outer
        }
        println(i)
        return
    }

    println(1)
}