#include<iostream>
using namespace std;
int main(void){
    long long  a,b,c,A,B;
    while(cin >> a >> b){
        A=a;
        B=b;
        while(b!=0){
            c=a%b;
            a=b;
            b=c;
        }
    cout<<a<<' '<<A/a*B<<endl;
    }
}
