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

  end
end
while (str = gets)
  a, b = str.split(" ").map(&:to_i)
  puts [gcd(a, b), (a * b) / gcd(a, b)].join(" ")
end
