while a = gets
  s, t = a.split.map(&:to_i)

  a = s; b = t
  if b > a
    z = b; b = a ; a = z
  end

  unless a % b == 0
    c = a % b; a = b; b = c
  end
  lcm = b
  gcd = s / b * t
  puts "#{lcm} #{gcd}"
end