#include <iostream>
using namespace std;

int GCD(int a,int b){
	int temp;
	while(b!=0){
		temp=b;
		b=a%b;
		a=temp;
	}
	return a;
}

int LCM(int a,int b,int gcd){
	a/=gcd;
	b/=gcd;
	return a*b*gcd;
}

int main() {
	int a,b,gcd,lcm;
	while(cin>>a>>b){
		if(b>a) swap(a,b);
		gcd=GCD(a,b);
		lcm=LCM(a,b,gcd);
		cout<<gcd<<" "<<lcm<<endl;
	}
	return 0;
}