lines = []
while line = gets
    lines << line.chomp.split(' ').map(&:to_i)
end

N = lines[0][0]

cand = []
for i in 1..10**5 do
  if lines[1][0] % i == 0 then
    cand.push(i)
    cand.push(lines[1][0] / i)
  end
  if lines[1][1] % i == 0 then
    cand.push(i)
    cand.push(lines[1][1] / i)
  end
end
cand.uniq!.sort!

ans = 0
cand.each do |i|
  num_div = 0
  for j in 1..N do
    if lines[1][j-1] % i == 0 then
      num_div += 1
    end
  end
  if num_div >= N-1 then
    ans = i
  end
end
    
puts ans