#include <iostream>
#include <cstdio>
using namespace std;
int main(){
    int a,b;
    while(scanf("%d %d",&a,&b)){
        int i,c,ans1,ans2;
        c=a;
        if(a<b){
            a=b; b=c;
        }
        i=a%b;
        ans2=b;
        while(i){
            c=i;
            i=b%i;
            b=c;
        }
        ans1=b;
        ans2=ans2/b*a;
        printf("%d %d\n",ans1,ans2);
    }
    return 0;
}