def gcd(a, b) 
  if b === 0
    return a
    
  end
  return gcd(b, a % b)
end

def lcm(a, b)
  return a * b / gcd(a, b)
end

while line = gets
  array = line.chomp.split(' ').map(&:to_i)
  a = array[0]
  b = array[1]
  x = gcd(a, b)
  y = lcm(a, b)
  printf("%d %d\n", x, y)
end
