#include <iostream>
using namespace std;
int main() {
    long  a;
    long b;
    unsigned long long c;
    while(cin>>a>>b){
        c=a*b;
        while(a%b!=0&&b%a!=0){
            if(a>b){
                a=a%b;
            }
            else if(b>a){
                b=b%a;
            }
        }
        if(a>b) cout<<b<<" "<<c/b<<endl;
        else cout<<a<<" "<<c/a<<endl;
        c=0;
    }
    return 0;
}