import java.util.Scanner
import scala.annotation.tailrec

object Main{
  val sc = new Scanner(System.in)
  def main(args: Array[String]): Unit ={
    val n = sc.nextInt

    val l = List.fill(n)(sc.nextInt).sorted(Ordering[Int].reverse)

    val r =
      l.foldLeft(2 * l(0)) {(res, acc) =>
        if(res == acc) res
        else gcd(res, acc)
      }
    println(r)
  }

  @tailrec
  def gcd(a: Int, b: Int): Int ={ (a, b) match{
    case (a , 0) => a
    case _ => if(a < b) gcd(b, a) else gcd(a % b, b)
  }
  }
}