#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;
			}
		}
		int flag=1;
		for(int i=1;i<=10000,flag;++i){
			for(int j=1;j<=10000;++j){
			//cout<<n1*i<<" "<<n2*j<<endl;
				if(n1*i==n2*j){
					a2=n1*i;
					flag=0;
					break;
				}
			}
		}
		cout<<a1<<" "<<a2<<endl;
	}
}