def gcd(a,b)
  while b > 0
    a, b = b,a%b
  end
  return a
end

n = gets.to_i
a = gets.split.map(&:to_i)

max = 0

(0..n-1).each  do |y|
  gcd = 0
  (0..n-1).each do |x|
    gcd = gcd(a[x],gcd) if x != y
  end
  max = gcd if gcd > max;
end

puts max