while data = gets do
  if data == nil then
    break
  end
  a,b = data.split().map(&:to_i).sort()

  gcd = 1
  i = 1
  while i <= a do
    if a%i == 0 and b%i == 0 then
      gcd = i
    end
    i += 1
  end

  lcm = a*b/gcd

  puts "#{gcd} #{lcm}"
end