import java.util.Scanner
object Main{
    def main(args:Array[String]):Unit = {
        val scan = new Scanner(System.in)
        var res_gcd = List[Long]()
        var res_lcm = List[Long]()
        var count = 0
        while(scan.hasNextLong()){
            val a = scan.nextLong()
            val b = scan.nextLong()
            res_gcd :+= gcd(a,b)
            res_lcm :+= lcm(a,b)
            count+=1
        }

        for(i <- 0 to count-1) println(s"${res_gcd(i)} ${res_lcm(i)}")

    }

    def gcd(a:Long,b:Long):Long = if(b == 0) a else gcd(b,a%b)
    def lcm(a:Long,b:Long):Long = a*b/gcd(a,b)
}