data = []

while data = gets
	data = data.split(nil)
	data.map!{|n| n.to_i}

	data.sort!
	a = data[0]
	b = data[1]

	r = b % a

	while r != 0
		b = a
		a = r
		r = b % a
	end
	ans = a

	a = data[0]
	b = data[1]

	while a % b != 0
		a = a + data[0]
	end

	puts printf("%d %d", ans, a)
end