let N = stdin.ReadLine() |> int
let A = stdin.ReadLine().Split()|>Array.map int|>Array.sort

let rec gcd a b = 
    if b = 0 then a
    else gcd b (a%b)


let mutable cand = Set.empty

for i in [1..int(sqrt(float A.[0]))+1] do
    if A.[0] % i = 0 then 
        cand <- cand.Add i
        cand <- cand.Add (A.[0] / i)

for i in [1..int(sqrt(float A.[1]))+1] do
    if A.[1] % i = 0 then 
        cand <- cand.Add i
        cand <- cand.Add (A.[1] / i)


let l = Set.toArray cand |> Array.rev

Array.iter (fun x -> let aa = Array.filter (fun t -> t % x > 0) A in
                     let sz = Array.length aa in
                     if sz <= 1 then (printfn "%d" x; exit 0)) l
