while line = gets
	num = []
	num = line.split(nil).map{|n| n.to_i}.sort!
	avoid  = [num[0],num[1]]
	while num[0] != num[1]
		num[1] = num[1] - num[0]
		num.sort!
	end
	max = num[0]
	x = avoid[0] / max
	y = avoid[1] / max
	min = x * y * max
	puts "#{max} #{min}"
end
	