object Main {
  def main(args:Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    while (sc.hasNext){
      val a, b = sc.nextInt
      val g = gcd(a, b)
      val l = a / g * b
      println(g + " " + l)
    }
  }
  def gcd(a: Int, b: Int): Int = {
    if (b ==0) a else gcd(b, a%b)
  }
}