#include <iostream>

using namespace std;

long long gcd(long long a,long long b){
	long long  r=0;
	while((r=a%b)!=0){
		a=b;
		b=r;
	}

	return b;
}


int main (void){
	long long a,b,r;
	while(cin>>a>>b){
		if(a<b){
			a+=b;
			b=a-b;
			a-=b;
		}

		cout<<gcd(a,b)<<" "<<a*b/gcd(a,b)<<endl;
	}
}