
def calcGCD(a, b)
  m = [a, b].max
  n = [a, b].min

  while n > 0
    if (n == 0)
      break
    else
      nn = n
      n = m % n
      m = nn
    end
  end
  return m
end

inputs = []
while (line = gets) != nil
  inputs.push(line.split())
end

for i, j in inputs
  a = i.to_i
  b = j.to_i
  g = calcGCD(a, b)
  l = a * b / g
  puts printf("%d %d", g, l)
end