#include<iostream>
#include<cstdio>
using namespace std;

int main(){
	long a,b,tmp,i;
	
	while(cin>>a>>b){
		if(a>=b) i=a;
		else i=b;
		
		for(;0!=(a%i)+(b%i);i--);
		cout<<i<<" "<<a*b/i<<endl;
	}
	return 0;
}