require 'prime'

n = gets.to_i
a, b, c = gets.split.map &:to_i
g = (n == 2 ? gcd(a, b) : gcd(a, gcd(b, c)))

hash = Hash.new(0)
Prime.each(Math.sqrt(g).to_i){|p|
    while g % p == 0
        hash[p] += 1
        g /= p
    end
}
hash[g] += 1 if g > 1
puts hash
        .map{|p, k| (0..k).map{|i| p**i}}
        .inject(&:product)
        .map{|a| a.flatten.inject(:*)}
        .sort