def gcd(a,b)
	a,b = b,a if b>a
	if a % b == 0
		b
	else
		gcd(b,a%b)
	end
end

def lcm(a,b)
	a*b/gcd(a,b)
end

while line = gets
	break if line == "\n"
	a,b = line.split
	puts "#{gcd(a.to_i,b.to_i)} #{lcm(a.to_i,b.to_i)}"
end