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

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

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