def get_kouyakusu(a, b)
  loop do
    rem = b % a
    return a if rem == 0
    a, b = rem, a
  end
  nil
end

while str = gets
  break if str.nil? || str.empty?
  a, b = str.split(' ').map(&:to_i).sort

  # ????????????????????§?????? / ?????§??¬?´???°
  koyakusu = get_kouyakusu(a, b)
  raise 'No result' unless koyakusu

  kobaisu = (a * b / koyakusu)

  puts "#{koyakusu} #{kobaisu}"
end