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)

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