object Main {
  def main(args: Array[String]) {
    var points = Array[Int]()
    var count = 0
    for(line <- io.Source.stdin.getLines()) {
      val temp_point = line.split(' ').map{_.toInt}
      if(count == 0) {
        points = points :+ temp_point(1)
      }
      else {
        for(c <- temp_point) {
          points = points :+ c
        }
      }
      count += 1
    }

    points = points.sorted.distinct
    
    var step = 1000000000
    var first_check = true
    for(i <- 1 to points.length - 1) {
      val diff = (points(i) - points(i - 1)).abs
      if(first_check) {
        if(step > diff) {
          step = diff
        }
        first_check = false
      }
      else {

        val temp_gcd = gcd(step, diff%step)
        if(step > temp_gcd) {
          step = temp_gcd
        }
      }
    }

    println(step)
  }

  def gcd(a: Int, b: Int): Int = {
    if (b == 0) {
      a
    }
    else {
      gcd(b, a%b)
    } 
  }
}
