import java.util.Scanner

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

    val numbers: List[Int] = sc.nextLine().split(" ").map(_.toInt).toList
    if (numbers.distinct.length == 1) {
      println(numbers(0))
    } else {

      val ans = numbers.distinct.map {
        omitTarget => numbers.filterNot(n => n == omitTarget).reduce((x, y) => gcd(x, y))
      }.max
      println(ans)
    }
  }

  def gcd(x: Int, y: Int): Int = {
    if (y == 0) x
    else gcd(y, x % y)
  }
}