N = gets.to_i
A = gets.split(" ").map(&: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

ans = 0
A.each_with_index do |e, i|
  a = A.clone
  a.delete_at(i)
  n = ngcd(a)
  if ans < n
    ans = n
  end
end
puts ans
