object Main extends App {
  val in = scala.io.Source.stdin.getLines.toSeq
  val ls = in.map(_.split(' ').map(_.toInt).toIndexedSeq).tail.head

  var ss = ls.distinct.sorted
  var lastMin = Int.MaxValue
  var min = Int.MaxValue
  //var ss = s//.toIndexedSeq
  do {
    //lastMin = min
    lastMin = ss.size
    val d = (1 until ss.size).map(i => ss(i) - ss(i-1))
    //ss ++= d
    //ss = ss.sorted.distinct
    ss = (ss ++ d).distinct.sorted
    min = ss.head
    //println(ss.toSeq)
  //}while(lastMin != min.size)
  }while((lastMin != ss.size) && (min != 1) && (ss.count(e => e % min != 0) != 0))
  println(min)
}
