[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.toList |> List.map f

let gcd x y =
    let rec aux x y = if y = 0 then x else aux y (x % y)
    aux (abs x) (abs y)

[<EntryPoint>]
let main _ =
    let n = read int
    let xs = reads int |> List.toSeq
    let ls = Seq.scan gcd 0 xs
    let rs = Seq.scanBack gcd xs 0 |> Seq.tail
    Seq.zip ls rs
    |> Seq.map (fun (l, r) -> gcd l r)
    |> Seq.max
    |> printfn "%i"
    0