x=require('fs').readFileSync('/dev/stdin','utf8').split(/\s/);
i=0;
for(;i<x.length-3;){
if(x[i++]<x[i++]){
    tmp = x[i-2];
    x[i-2] = x[i-1];
    x[i-1] = tmp;
  }
l=x[i-2]*x[i-1];
r = x[i-2] % x[i-1];
  while(r!==0){
    x[i-2] = x[i-1];
    x[i-1] = r;
    r = x[i-2] % x[i-1];
  }
console.log(x[i-1], l/x[i-1]);
}