#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b){
	int r;
	r = a % b;
	if(r==0)
		return b;
	else
		return gcd(b,r);
}
int main(){
	int a,b;
	while(cin >> a >> b){
		int result = gcd(a,b);
		int lcm = a*(b/result);
		cout << result << " " << lcm << endl;
	}
	return 0;
}