#include <iostream>
#include <algorithm>
using namespace std;
int main(){
	long long a,b,yakuans,baians;
	while(cin>>a>>b){
		long long c;
		c=a*b;
		if(b>a)swap(a,b);
		while(1){
			long long r;
			r=a%b;
			if(a%b==0)break;
			a=b;
			b=r;
		}
		baians=c/b;
		cout<<b<<" "<<baians<<endl;
	}
	return 0;
}