object Main {
  def main(args:Array[String]):Unit = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val list = List.fill(n)(sc.nextLong)
    println(list.reduceLeft(gcd))
  }

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