#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
main(){
	int n1,n2,a1,a2;
	while(cin>>n1>>n2){
		int mx=max(n1,n2);
		for(int i=mx;i>0;--i){
			if(n1%i==0 && n2%i==0){
				a1=i;
				break;
			}
		}
		a2=(n1/a1)*n2;
		cout<<a1<<" "<<a2<<endl;
	}
}