#! /usr/bin/env ruby
# coding: utf-8
while n = gets.to_i
  break if n == 0
  b = []
  c = []
  gets.split.map(&:to_i).each do |t|
    b << t if t % 2 == 0
    c << t if t % 2 == 1
  end
  b.sort!
  c.sort!

  e = Math.sqrt(b[0] * b[1] / c[0]).to_i
  puts e
  puts b.map{|l| l / e}.join(' ')
end