n = gets.chomp.to_i
a_array = gets.chomp.split.map(&:to_i)

divisors = []
n.times do |replace_num_index|
  divisor = 0
  a_array.each_with_index do |a, a_array_index|
    next if a_array_index == replace_num_index
    if divisor < 1
      divisor = a
      next
    end
    u1 = [divisor, a].max
    u2 = [divisor, a].min
    while u2 != 0
      q = u1 / u2
      r = u1 % u2
      u1 = u2
      u2 = r
    end
    divisor = u1
  end
  divisors.push(divisor)
end
puts divisors.max