def eucly(arr) #[max, min]
   ans = arr[0] % arr[1]
   if ans == 0
	  return arr[1]
   else
	  eucly([arr[1], ans])
   end
end

while line = gets
   num = line.split(' ').map(&:to_i)
   if num[0] < num[1]
	  arr[0], arr[1] = num[1], num[0]
   else
	  arr = num
   end
   gcd = eucly(arr)
   lcm = num[0]*num[1]/gcd
   print gcd.to_s + " " + lcm.to_s + "\n"
end