io = STDIN
n=io.gets.to_i
a=io.gets.split.map(&:to_i)
ans=0
ans = a[0].gcd(a[1])
if n==2
  p [a[0],a[1]].max
else
  ans=[ans,a[1].gcd(a[2]),a[0].gcd(a[2])].max
  (2...n).each do |i|
    ans = [ans,ans.gcd(a[i])].max
  end
  p ans
end
