#include<iostream>
using namespace std;

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