#include<iostream>
#include<string>
using namespace std;
int main(){
	int GCD,LCM,a,b,xb,xa;
	while(cin>>a>>b){
		if(a=0 || b== 0){continue;}
		xa=a;
		xb=b;
		while(1){
			if(xa>xb){
			xa = xa%xb; 
			}
			else if(xa<xb){
			xb = xb%xa;
			}
			if(xb==xa){break;
			}
		}
		GCD=xb;
		LCM=(a*b)/xb;
		cout<<GCD<<" ";
		cout<<LCM<<endl;
		
	}

	return 0;

}