N = gets.chop.to_i
A = gets.chop.split.map(&:to_i)

def array_gcd(array)
  array.inject do |max, i|
    max = max.gcd(i)
  end
end

gcd_list = (0..N-1).to_a.map do |i|
  array = A.dup
  array.delete_at(i)
  array_gcd(array)
end

p gcd_list.max