import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val lx = sc.nextInt()
  val x = (1..n).map { sc.nextInt() }.sorted()


  val list = x.map { Math.abs(lx - it) }

  val ngcd = ngcd(list)
  println(ngcd)

}

private fun gcd(a: Int, b: Int): Int {
  if (b > 0) {
    return gcd(b, a % b)
  }
  return a
}

private fun ngcd(a: List<Int>): Int {
  var res: Int
  res = a.get(0)
  for (i in 1 until a.size) {
      if (res == 1) break
      res = gcd(a.get(i), res)
  }
  return res
}