#include<iostream>
using namespace std;

int main(){
int i = 0;int a = 0;int b = 0;int aa = 0;int bb = 0;
while(!cin.eof()){
cin >> a >> b;
if(a >= b){
aa = b;bb = a;
}
else{
aa = a;bb = b;
}
while(aa != 0){
int c = 0;
bb = bb % aa;
c = aa;
aa = bb;
bb = c;
}
cout << bb << " " << a * b / bb << endl;

}
    return 0;
}