#include<cstdio>
long gcd(long a,long b){
    if(a<b){
        long t=a;
        a=b;
        b=t;
    }
    while(b!=0){
        long t=a;
        a=b;
        b=t%b;
    }
    return a;
}
int main(){
    int a,b;
    while(~scanf("%d%d",&a,&b)){
        long g=gcd(a,b);
        long l=a/g*b;
        printf("%ld %ld\n",g,l);
    }
}