object Main extends App {
  import scala.io.StdIn._

  val n = readInt
  val monsters = readLine.trim.split(' ').map(_.toInt)
  println(monsters.reduce(gcd))
  def gcd(a: Int, b: Int): Int = {
    b match {
      case 0 ⇒ a
      case _ ⇒ gcd(b, a % b)
    }
  }
  implicit class Scope[T](val value: T) extends AnyVal {
    @inline def also(@inline func: T ⇒ Unit): T = {
      func(value)
      value
    }
    @inline def let[A](@inline func: T ⇒ A): A = func(value)
  }

}