STDIN.each_line do |line|
	a,b = line.split.map(&:to_i).sort
	gcd = 0
	lcm = 1
	a.downto(1) do |num|
		if a%num == 0 and b%num == 0 then
			gcd = num
			break
		end
	end
	lcm = a*b/gcd
	puts "#{gcd} #{lcm}"
end