while true
    n = gets.to_i
    break if n == 0

    arr, min = [], nil
    gets.chomp.split.map(&:to_i).each{|x|
        arr << x if x.even?
        min = x if x.odd? && (min.nil? || min > x)
    }
    arr.sort!
    m = Math.sqrt(arr[0] * arr[1] / min).to_i
    puts m
    puts arr.map{|x| x / m}.join(" ")
end
