n=gets.to_f a=gets.chomp.split(/\s/).map(&:to_i) def ea(m,n) return m if n === 0 ea(n, m%n) end loop do gcd = a.reduce{|s,e|ea(s,e)} a.map!{|e|e/=gcd} break if gcd === 1 end puts a.join(":")