#include<iostream>
#include<string>
#include <algorithm>
#include<iomanip>
#include<cmath>
using std::cin; using std::string;
using std::cout; using std::endl;
using std::sort;
#define rep(X,Y) for(int (X)=0;(X)<(Y);++(X))
#define rept(X,Y,Z) for(int (X)=(Y);(X)<(Z);++(X))
#define repr(X,Y) for(int (X)=(Y);(X)>=0;--(X))
const double pi=3.141592653589793283462;
int main(){
    int a,b;
	 int gcd;
	 int lcm=0;
	while(cin>>a>>b){
	    for(int i=1;i<=b;i++){
		    if(a%i==0 && b%i==0)
			    gcd=i;
	        }
	    lcm=(a/gcd)*(b/gcd)*gcd;
	    cout<<gcd<<" "<<lcm<<endl;
	}
	return 0;
}     