/**
  * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0005
  * GCD and LCM
  */
object Main {
  def main(args: Array[String]): Unit = {
    Iterator.continually(io.StdIn.readLine()).takeWhile(_ != null).map(_.split(" +").map(_.toInt))
      .map { case Array(a, b) => (gcd(a, b), lcm(a, b)) }
      .foreach { case (g, l) => println(s"$g $l") }
  }

  def gcd(m: Int, n: Int): Int = {
    (m, n) match {
      case (a, b) if a < b => gcd(b, a)
      case (a, b) if b == 0 => a
      case (a, b) => gcd(b, a % b)
    }
  }

  def lcm(m: Int, n: Int): Int = {
    (m, n) match {
      case (a, b) if a < b => lcm(b, a)
      case (a, b) => (a.toLong * b.toLong / gcd(a, b).toLong).toInt
    }
  }
}