require "rational"
while line = gets
	test = line.split(/\s+/)
	tmp=[]
	tmp[0]=test[0].to_i
	tmp[1]=test[1].to_i
	test[0]=tmp[0].gcd(tmp[1]) 
	test[1]=tmp[0].lcm(tmp[1])
	print test[0]
	print(" ")
	puts test[1]
end