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

def gcd(a, b)
  gcd(b, a) if b > a
  return b if (r = a % b).zero?
  gcd(b, r)
end

def fac(n)
  factors = []
  2.upto n do | i |
    factors << i if n % i == 0
  end
  factors
end

if an.size == 2
  p an.max
  exit
end

if an.size == 3
  p [gcd(an[0], an[1]), gcd(an[0], an[2]), gcd(an[1], an[2])].max
  exit
end

an.sort!
factors = fac(an[0]).push(an[1]).sort{|a,b|b<=>a}.uniq.flatten

factors.each do | f |
  is_vali = 0
  an.each do | a |
    is_vali += 1 if a%f != 0
  end
  if is_vali < 2
    p f
    exit
  end
end