import java.io.InputStreamReader
import java.io.BufferedReader

fun main(args: Array<String>) {
  val br = BufferedReader(InputStreamReader(System.`in`))

  br.readLine()
  val a = br.readLine().split(" ").map { it.toInt() }

  tailrec fun gdc(a: Int, b: Int): Int =
    if(b == 0) a
    else gdc(b, a % b)

  val ans = a.reduce { a, b -> gdc(b, a) }
  println(ans)
}