var input = [];
process.stdin.resume();
process.stdin.setEncoding("utf8");
process.stdin.on('data', function(chunk){
   input = chunk.toString("utf8").trim().split("\n");
});
process.stdin.on('end', function(){
    for (var i = 0; i < input.length; i++) {
    var data = input[i].split(" ").map(Number);
    var a = data[0],
        b = data[1];
        
    var GCD,
        LCM;
    while(b != 1){
        if(a === b) break;
        sortedData = [a,b].sort(function(a,b){
            if (a < b) {
                return 1
            }else if(a > b){
                return -1
            }
            return 0
        });
        b = sortedData[0] - sortedData[1];
        a = sortedData[1]
    }
    GCD = b;
    LCM = data[0] * data[1] / GCD;
    console.log(GCD + " " + LCM)
    }
    
});