import java.util.Scanner

object Main {
  def main(args: Array[String]) {
    val result = solve(new Scanner(System.in))
    if (result.length > 0) println(result)
  }

  def solve(in: String): String = solve(new Scanner(in))

  def solve(sc: Scanner): String = {
    val N = sc.nextInt
    var A = Array.fill(N)(sc.nextInt).sorted.distinct

    while (A.length > 1) {
      val a = A.head
      A = (a +: A.tail.map(_ % a).filter(_ > 0)).sorted.distinct
//      println(A.mkString(","))
    }

    A.head.toString
  }
}
