def get_divs x
    arr = []
    1.upto(x){|y|
        arr << y if x % y == 0
    }
    return arr
end

n = gets.to_i
arr = gets.chomp.split.map(&:to_i)
divs = []
arr.each_with_index{|x, i| divs[i] = get_divs(x)}
cd = divs[0].find_all{|x| divs.all?{|ar| ar.include?(x)}}
puts cd
