import scala.io.{StdIn => in}

object Main extends App {
  val n = in.readInt
  val ms = in.readLine.split(" ").map(_.toInt).sorted

  val dMin = ms./:(Int.MaxValue)((acc,i) => {
    val v = i % acc
    (math.min(acc, if(v!=0) v else acc))
  })

  // println(dMin)

  val res = if(dMin == 1) 1
    else ms./:(Int.MaxValue)((acc,i) => {
    val v = i % dMin
    val s = if(v != 0) v else acc
    math.min(acc,s)
  })

  val min = math.min(dMin,res)

  // println(min)

  val ans = math.min(ms.head,min)
  println(ans)
}