
def gcd(x, y)
  if(y == 0)
    return x
  else
    return gcd(y, x%y)
  end
end

while data = gets
  a, b = data.chomp.split
  a, b = a.to_i, b.to_i
  g = gcd(a, b)
  l = (a*b)/g
  print g, " ", l, "\n"
end

