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

if n == 2 then
  puts arA.max
  exit
end

def maxDivisor(nums)
  lesser_num = nums.min

  (1..lesser_num).to_a.reverse_each do |i|
    flg = true
    nums.each do |j|
      if j % i != 0 then
        flg = false
        break
      end
    end

    if flg then
      return i
    end
  end
end

ar = []
for i in 0..(n-1) do
  arTemp = []
  arTemp << arA
  arTemp.flatten!.delete_at(i)
  ar << maxDivisor(arTemp)
end

puts ar.max
