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

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

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

an.sort!
gcds = [gcd(an[0], an[1]), gcd(an[1], an[2]), gcd(an[0], an[2])]

kou = []
gcds.each do | g |
  2.upto g do | i |
    kou << i if g%i == 0
  end
end
kou.sort!.uniq!

max = 0
kou.each do | k |
  is_valid = 0
  an.each do | a |
    is_valid += 1 if a%k != 0
  end
  max = k if is_valid < 2
end
p max