N = gets.to_i
As = gets.split.map(&:to_i)

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

max = 0

As.sort!

As.length.times do |i|
  as_ = As.dup
  as_[i] = as_[As.length - 1]
  
  m = as_.gcd
  
  if max <= m
    max = m
  end

end


puts max