#! ruby -Ku





while data =gets.chomp
	data = gets
	if data == nil
		break
	end
x=1
y=1
z=1
gcd=[]
gcda=[]
gcdb=[]

lcma=[]
lcmb=[]

	a,b=data.split(" ").map{|num| num.to_i}
	i=2
	while i <= a || i <= b
		if a%i==0 && b%i==0
#		p "a=#{a} b=#{b} i=#{i}  ab??????"
			gcd << i
			a = a/i
			b = b/i
			redo
		elsif a%i==0
#		p "a=#{a} b=#{b} i=#{i}  a??????"
			gcda << i
			a = a/i
			redo
		elsif b%i==0
#		p "a=#{a} b=#{b} i=#{i}  b??????"
			gcdb << i
			b = b/i
			redo
		end
		i+=1
#		p "#{a} #{b}"
	end


gcda.each do |i|
	x=x*i 
end

gcdb.each do |i|
	y=y*i 
end

gcd.each do |i|
	z=z*i 
end

#puts "#{gcd} #{x} #{y} #{z} #{x*y*z}"
puts "#{z} #{x*y*z}"

end