def ngcd(ns)
    return ns[0] if ns.length == 1
    return gcd(ns[0], ns[1]) if ns.length == 2
    tmp = gcd(ns[0], ns[1])
    ns[-2] = tmp
    ngcd(ns[0..-2])
end

def gcd(a, b)
    return a if b == 0
    return gcd(b, a%b)
end

def test
    n = gets.to_i
    as = gets.split(" ").map(&:to_i)
    ans = 0
    n.times do |i|
        tmp = as.dup
        tmp.delete_at(i)
        g = ngcd(tmp)
        ans = g if g > ans
    end
    ans
end

p test