module Input
	def numread()
		s = gets().split()
		p = Array.new()
		for i in 0...s.size()
			p[i] = s[i].to_i()
		end
		return p
	end
	
	module_function:numread
end

include Input

def gcd(x,y)
	w = y % x
	if(w == 0)
		return x
	else
		return gcd(w,x)
	end
end

loop{
	if(STDIN.eof())
		break
	end
	w = numread()
	w.sort!()
	s = gcd(w[0],w[1])
	l = w[0] * w[1] / s
	print(s," ",l,"\n")
}