def get_gcm( a, b )
	while (r = a % b) > 0
		a = b
		b = r
	end
	return b
end

def get_lcm( a, b )
	gcm = get_gcm( a, b ) 
	return a * b / gcm
end

answer = Array.new

while linestr = $stdin.gets
	line = linestr.split( /\s/ )
	a = line[ 0 ].to_i
	b = line[ 1 ].to_i
	if a < b 
		t = a
		a = b
		b = t
	end
	answer << [ get_gcm(a,b), get_lcm(a,b) ]
end

answer.each{ |a|
	printf( "%d %d\n", a[0], a[1] )
}
