while num = gets
  num = num.split().map(&:to_i).sort
  buf = num[0] * num[1]

  while num[1] % num[0] != 0
    temp = num[0]
    num[0] = num[1] % num[0]
    num[1] = temp
  end

  num[1] = buf / num[0]

  puts "#{num[0]} #{num[1]}"
end