def Gcd(a, b)
	tmp = 0
	while (a % b != 0)
		tmp = b
		b = a % b
		a = tmp
	end
	return b
end

def Lcm(a, b)
	return a * b / Gcd(a, b)
end

while nums = gets
	a, b = nums.split(' ').map(&:to_i)
	puts sprintf("%d %d", Gcd(a, b), Lcm(a, b))
end