#include <bits/stdc++.h>
using namespace std;

int main(void){
    long long int a,b,tmp;
    while (cin>>a>>b) {
        long long int A=a;
        long long int B=b;
        if (b>a) {
            tmp=b;
            b=a;
            a=tmp;
        }
        while (a%b!=0) {
            tmp=b;
            b=a%b;
            a=tmp;
        }
        cout<<b<<" "<<(A*B/b)<<endl;
    }
}

