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

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

while line = gets do
  a, b = line.split.map(&:to_i)
  
  g = gcd(a, b)
  l = lcm(a, b, g)
  print "#{g} #{l}"
end