#include<iostream>
using namespace std;
int main(){
    int a,b,gcd,lcm;
    while(cin >> a >> b){
        for(int c=1;c<=a;c++){
            if(a%c==0&&b%c==0) gcd=c;
        }
        lcm = a*b/gcd;
        cout << gcd << " " << lcm << endl;
    }
    return 0;
}