object Main extends App{
  val firstLine = readLine.toInt
  val physicals = readLine.split(" ").map(_.toInt)
  
  def gcm(a: Int, b: Int): Int = {
    if (a - b == 0) {
      return a
    } else if (a - b > 0) {
      gcm (a-b, b)
    } else {
      gcm (b-a, a)
    }
  }
  
  val g = physicals.sorted.foldLeft(physicals.head) { (acc, x) =>
    if (acc == 1) {
      1
    } else {
      gcm(acc, x)
    }
  }
  println(g)
}