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(func(list.head, list.tail))
  }

  def func(head:Long, list:List[Long]) : Long = {
    if(list.size == 1) gcd(head,list.head) else func(gcd(head,list.head),list.tail)
  }

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