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