#include<iostream>
#include<algorithm>
using namespace std;
int a[2];
int main(){
	while(cin>>a[0]>>a[1]){
		sort(a,a+2);
		for(int i=a[0];;i--){
			if(a[0]%i==0&&a[1]%i==0){
				cout<<i<<" "<<(long long)a[0]*a[1]/i<<endl;
				goto loop;
			}
		}
		loop:;
		age:;
	}
	return 0;
}				
