#include<iostream>
using namespace std;

long long int gcd(long long int a, long long int b){
	long long int tmp;
	if(b>a) {tmp=b;b=a;a=tmp;}

	if(a%b==0) return b;
	else gcd(b,a%b);
}

int main(void){
	long long int a, b;
	while(cin >> a >> b){
		cout << gcd(a,b) << " " << a*b/gcd(a,b) << endl;
	}
	return 0;
}
	