#include<iostream>
using namespace std;

int main(){
    unsigned int a,b,c;
    int g[50];
    int l[50];
    int p;
    for(int i=0;i<50;i++){
        cin>>a>>b;
        p=a*b;
        while(b!=0){
            c=b;
            b=a%b;
            a=c;
        }
        g[i]=a;
        l[i]=p/g[i];
    }
    for(int i=0;i<50;i++){
        cout<<g[i]<<" "<<l[i]<<endl;
    }
    return(0);
}