def gcd(x, y)
  a, b = [x, y].max, [x, y].min
  until b == 0
    a, b = b, a % b
  end
  return a
end

while line = gets
  x, y = line.chomp.split(" ").map(&:to_i)
  gcd = gcd(x, y)
  lcm = x * y / gcd
  puts "#{gcd} #{lcm}"
end