import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val a = (1..n).map { sc.nextInt() }.sorted()


  var list = a
  var min = 0
  while (list.size > 1) {
    min = list[0]
    val list2 = mutableListOf<Int>()
    list2.add(min)
    for (i in 1 until list.size) {
      val tmp = list[i] % min
      list2.add(tmp)
    }
    list = list2.filter { it > 0 }.sorted()
  }

  println(min)


}