#include<iostream>
#include<sstream>
#include<cstdio>
#include<fstream>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<algorithm>
#include<string>
#include<cmath>
#include<cstdlib>
using namespace std;

#define ull unsigned long long

ull mcd(ull a,ull b){
	ull r = a%b;
	ull q = b;
	while(r>0){
		ull c = r;
		r = q%r;
		q = c;
	}
	return q;
}

int main(){
	ull n,m;
	while(cin>>n>>m){
		ull w = mcd(max(n,m),min(n,m));
		cout<<w<<" "<<(n*m)/w<<endl;
	}
	return 0;
}	