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

          if(step  == 1000000000) {
            step = diff
          }
          else {
            val temp_gcd = gcd(step, diff%step)
            if(step > temp_gcd) {
              step = temp_gcd
            }
          }
        }
      }
      count += 1
    }

    println(step)
  }

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