N =gets.to_i
vs = gets.chomp.split(' ').map(&:to_i)
ans=0
if N == 2
  puts vs[0].gcd(vs[1])
else
  for i in 0..N-1
    tmp = (vs-[vs[i]]).inject{|a,b|a.gcd(b)}
    ans = tmp if tmp > ans
  end
  puts ans
end