def gcd(*nums)
	return nums.inject do |a, b|
		a, b = b, a % b until b.zero?
		a
	end
end

def lcm(*nums)
	return nums.inject {|a, b| a * b / gcd(a, b)}
end

$<.each_line do |line|
	a, b = line.split.map(&:to_i)
	puts "#{gcd(a, b)} #{lcm(a, b)}"
end