#include <stdio.h>

int main(){

int i,a,b,p,q,r;

while(scanf("%d",&a)!=EOF){

scanf("%d",&b);

p=a;
q=b;

for(i=0;i<1000;i++){

r = p%q;
if(r==0) break;

p=q; q=r;

}

printf("%d %d\n",q,a*b/q);

}

return 0;
}