object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt
  val a = Array.fill(n)(sc.nextInt).distinct

  val ans = a.reduceOption(gcd)

  ans match {
    case Some(e) => println(e)
    case None => println(a(0))
  }

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