n = gets.to_i
a = gets.split().map {|v| v.to_i}

def gcd(a, b)
  a = -a if a < 0
  b = -b if b < 0
  while b > 0
    a, b = b, a % b
  end
  a
end

def ngcd(nums)
  d = 0
  nums.each { |a| d = gcd(d, a)}
  d
end

max = 1

a.combination(a.size - 1).collect do |arr|
  ret = ngcd(arr)
  max = ret if max <= ret
end

p max
