#include <stdio.h>
#include <math.h>

int main(){
    int a,b,x,y,t;
    int gcd,r;
    int l;
    while (scanf("%d %d",&x,&y)!=EOF){
    a = x;
    b = y;

    if(b==0) gcd = b;
    else if(a==0) gcd = b;
    else{
        while(b!=0){
            t = a/b;
            r = a% b;
            a = t;
            b = r;


        }
        gcd = a;
    }

    l = (x * y)/gcd;
    printf("%d %d",gcd,l);
    }

    return 0;


}