#include<iostream>
#include<string>
using namespace std;
int main(){
	int a,b,GCD,LCM,r,xa,xb;
	while(cin>>a>>b){
		xa=a;xb=b;
		while(xa!=xb){
			if(xa>xb){
			xa = xa%xb;
			}
			else{
			xb = xb%xa;
			}

		}
		
		LCM=(a*b)/xb;
		cout<<xb<<" ";
		cout<<LCM<<endl;
	}

	return 0;

}