include <iostream>
#include <vector>
using namespace std;
int main() {
 int a,b,c,x,y;
 vector<int> lc,gc;
 while(cin >> a >> b) {
 x=a; y=b;
 while( a % b!=0) { c=b; b=a % b; a=c; }
 lc.push_back(b); y=y/b; gc.push_back(y*x);
 }
 for (c=0;c<lc.size();c++) cout << lc[c] << " " << gc[c] << endl; 
 return 0;
}