var input = '';
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
    input += chunk;
});
process.stdin.on('end', function() {
    main(input)
});

function main(input){
    var args = input.trim().split('\n');

    args.forEach(function(data){
        data = data.split(' ').map(Number);
        solve(data[0], data[1]);
    })
}

function solve(a, b){
    if(a < b){
        var tmp = b;
        b = a;
        a = tmp;
    }
    var gcd = calcGcd(a, b);
    var lcm = a * b / gcd;
    console.log(gcd + ' ' + lcm);
}

function calcGcd(a, b){
    if(b <= 0){
        return a;
    }
    return calcGcd(b, a % b);
}