object Main {
    def main(args:Array[String]) = {
        val sc = new java.util.Scanner(System.in)
        while(sc.hasNextInt) {
            val a = sc.nextInt
            val b = sc.nextInt
            println(gcd(a, b) + " " + lcm(a, b))
        }
    }
    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)
}