class Array
  def gcd
    self.inject{|a,b| a.gcd(b)}
  end
end
n = gets.chomp.to_i
as = gets.split.map(&:to_i).freeze
ans = 0
n.times do |i|
  tmp_as = as.dup
  tmp_as.delete_at(i)
  tmp_gcd = tmp_as.gcd
  ans = tmp_gcd if tmp_gcd > ans
end
puts ans