import java.util.Scanner

object Main extends App  {
  val sc = new Scanner(System.in)

  val n = sc.nextInt


  val al = List.fill(n)(sc.nextInt)

  val res =
    (0 until n).foldLeft(1){(max, i) =>
      val t2 = al.zipWithIndex.filter(_._2 != i).map(_._1)

      val temp = t2.tail.foldLeft(t2.head)(gcd(_,_))

      Math.max(max, temp)
    }
  println(res)

  def gcd(a: Int, b: Int): Int ={
    (a,b) match{
      case (x,y) if y == 0 => x
      case (x,y) if x < y  => gcd(y, x)
      case (x,y)           => gcd(y, x % y)
    }
  }

}
