#include<iostream>
#include<cstdio>
using namespace std;

int main(){
    int a,b,a1,b1,r;
    int tmp=0;
    int i=0;
    
    while(scanf("%d %d",&a,&b)){
        if(a<b){
            tmp=a;
            a=b;
            b=tmp;
        }
        
        a1=a;
        b1=b;
        r=a1%b1;
        while(r!=0){
            a1=b1;
            b1=r;
            r=a1%b1;
            
        }
        printf("%d %ld\n",b1,(long)a*b/b1);
    }
    
    
    return 0;
    
}