#!/usr/bin/env ruby

n = STDIN.gets.chomp
nums = STDIN.gets.chomp.split(' ').map &:to_i

min = nums.min
min.downto(1) do |i|
  tmp = nums.select{|n| n % i != 0 }
  if tmp.length <= 1
    puts i
    exit
  end
end
