import java.util.Scanner
 
import scala.annotation.tailrec
import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer
import scala.io.StdIn

object Main {
  def main(args: Array[String]) = {
    val sc = new Scanner(System.in)
    val N  = StdIn.readLine().toInt
    val As  = StdIn.readLine().split(" ").map(_.toInt)
    
    val a = As.indices.map { i =>
      val b = new ArrayBuffer[Int]
      As.map{ c =>
        b += c
      }
      b.remove(i)
      b
    }
    val ret = a.map(_.reduce(gcd)).max
    println(s"$ret")
  }
 
  @tailrec
  def gcd(x: Int, y: Int): Int = {
    if(y == 0) x
    else gcd(y, (x % y))
  }
}