import java.util.*
fun main(args: Array<String>) {

    val sc = Scanner(System.`in`)
    while (sc.hasNext()) {
        val list = Array(2, { sc.nextLong() })
        println(String.format("%d %d",gcd(list[0], list[1]),lcm(list[0], list[1])))
    }
    sc.close()
}

fun gcd(a: Long, b: Long): Long = if(a < b) gcd(b, a) else if(b == (0).toLong()) a else gcd(b, a % b)
fun lcm(a: Long, b: Long): Long = (a * b) / gcd(a, b)
