let [a,b] = require("fs").readFileSync(0,"utf8").toString().trim().split(' ').map(Number);
if(a<b) [a,b] = [b,a];
const GCD = (x,y) => y!==0 ? GCD(y, x%y) : x;
const gcd = GCD(a,b);
const lcm = a*b/gcd;
console.log(gcd);
console.log(lcm);