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

def gcd(list)
  list
  loop do
    m = list.min
    new_list = [m]
    list.each do |num|
      x = num.modulo(m)
      new_list << x unless x.zero?
    end
    list = new_list

    return m if new_list.count == 1
  end
end

ans = 1
n.times do |i|
  temp = as.clone
  temp.delete_at(i)
  m = gcd(temp)
  ans = m if ans < m
end

puts ans
