#include <iostream>

using namespace std;

int a,b;

int gcd(int x,int y);
int lcm(int x,int y);

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

int gcd(int x,int y){
	if(x==0&&y==0)return 0;
	while(x!=y){
		if(x>y)x=x-y;
		else y=y-x;
	}
	return x;
} 

int lcm(int x,int y){
	if(x==0&&y==0)return 0;
	return (x/gcd(x,y))*y;
}