object Main {

  def gcd(a: Long, b: Long): Long = if(b!=0) gcd(b,a%b) else a

  def lcm(a: Long, b: Long): Long = a * b / gcd(a,b)

  def loop(a: Array[Long]) {
    if (a != null) {
      println(gcd(a(0),a(1))+" "+lcm(a(0),a(1)))
      loop(scala.io.StdIn.readLine.split(" ").map(_.toLong))
    }
  }

  def main(args: Array[String]): Unit = {
    loop(scala.io.StdIn.readLine.split(" ").map(_.toLong))
  }
}