object Main extends App {

  def gcd(i: Long, reminder: Long): Long =
    if (reminder == 0) i else gcd(reminder, i % reminder)

  def lcm(n: Long, m: Long): Long = (n*m) / gcd(m, n)

  for (str <- io.Source.stdin.getLines) {
    val Array(n, m) = str.split(" ").map(_.toLong)
    println(s"${gcd(n, m)} ${lcm(n, m)}")
  }
}