object Main extends App {
  var N = readInt
  var get = readLine.split(" ")
  var max = 0
  var min = 1000000001
  for(i <- 0 until N){
    max = math.max(max,get(i).toInt)
    min = math.min(min,get(i).toInt)
  }
  N = max % min
  while(N != 0){
    max = min
    min = N
    N = max % min
  }
  println(min)
}