object Main extends App {
  var n = scala.io.StdIn.readInt()
  var a = scala.io.StdIn.readLine()
  val aArray =  a.split(" ").toVector.map(_.toInt)
  val amin = aArray.min

  def judgeMin(array: Vector[Int], min: Int):Int = {
    val divideArray = array.map(a=> (a, a % min))
    val divideResult = divideArray.map(_._2).max
    if(divideResult == 0) {
      min
    } else if (divideResult == 1) {
      divideResult
    } else {
      judgeMin(divideArray.filter(_._2 != 0).map(_._1), divideResult)
    }
  }
  println(judgeMin(aArray, amin))
}