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

n = gets.to_i
a = gets.split(" ").map(&:to_i)

max = 0

n.times do |i|
  b = a.dup
  b.delete_at(i)
  gcd = b.gcd
  max = gcd if max<gcd
end
  
p max
