import scala.io.Source.stdin

object Main extends App {
  def gcd(m:Long,n:Long):Long = if(n==0) m else gcd(n, m % n)

  for(s <- stdin.getLines.map(_.split(" ").map(_.toLong))) {
        val g = gcd(s(0),s(1))
        println(g + " " + (s(0)/g)*s(1))
  }
}