def gcd(m,n)
	n,m = m,n if m > n
	
	loop do
		r = n % m
		break if r == 0
		n,m = m,r
	end
	m
end

def lcm(m,n)
	n,m = m,n if m > n
	r = 1
	loop do
		return m * r if (m * r) % n == 0
		r += 1
	end
end

while gets
	a,b = $_.split.map(&:to_i)
	puts "#{gcd(a,b)} #{lcm(a,b)}"
end