process.stdin.resume();
process.stdin.setEncoding('utf8');
// ???????????????????¨??????§
// Let's ?????£??¬????????????
process.stdin.on('data', function (chunk) {
    var aaa = chunk.toString();
    var line = aaa.split("\n");
    function gcd(a,b){
    if(a === b){
        return a;
    }
    var r;
    while(b !== 0){
        r  = a % b;
        a = b;
        b = r;
    }
    return a;
}
    
    function lcm(a,b){
        return a * b / gcd(a,b);???//??¬???
    }  
    
    for(var i in line){
        var l = line[i].split(" ");
        for(var i in l){
            l[i] = new Number (l[i]);
        }
        console.log(gcd(l[0],l[1]),lcm(l[0],l[1]));
     
    }
    
});