class Array
  def gcd
    self.inject{|a,b| a.gcd(b)}
  end
end

n = gets.to_i
a = gets.split.map(&:to_i).sort
max = 0
a.length.times do |i|
  tmp = a.pop
  val = a.gcd
  max = val if val > max
  a.unshift(tmp)
end

puts max