#include<iostream>
using namespace std;
int getmax(int a,int b){
	if(b==0) return a;
	return getmax(b,a%b);
}
int getmin(int a,int b){
	return a*b/getmax(a,b);
}
int main(){
	int a;
	int b;
	int t;
	while(scanf("%d%d",&a,&b)){
	if(a>b){
		t=a;
		a=b;
		b=t;
	}
	cout<<getmax(a,b)<<endl;
	cout<<getmin(a,b)<<endl;
	}
	return 0;
}
		