while line = STDIN.gets
	if(/exit/ =~ line)
		break
	end
	temp = line.scan(/\d+/)
	a = temp[0].to_i
	b = temp[1].to_i
	if a < b then
		a, b = b, a
	end
	gcd = 0
	lcm = 0
	r = a % b
	a = b
	while b != 0
		b = a % r
		a = r
		r = b
	end
	lcm = r
	gcd = temp[0].to_i * temp[1].to_i / lcm
	print sprintf("%d %d\n",lcm,gcd);
end