import java.io.InputStream
import java.io.BufferedReader

fun gcd(a: Long, b:Long):Long {
  if(a%b==0L) return b else return gcd(b, a%b)
}

fun main(args: Array<String>) {
  val inputStream = System.`in`
  val allText = inputStream.bufferedReader()
                           .use(BufferedReader::readText)
  allText.trim().split('\n')
         .map { s->
            val t = s.split(' ').map{ t -> t.toLong() }
            val g = gcd(t[0], t[1])
            val l = (t[0] / g) * t[1]
            Pair(g, l)
         }
         .forEach{ t -> println("%d %d".format(t.first, t.second)) }
}
