#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a,long long b){
	if(a==0){
		return b;
	}
	return GCD(b%a,a);
}
int main()
{
    long long a,b;
    while(cin>>a>>b){
       	cout<<GCD(a,b)<<" "<<(a*b)/GCD(a,b)<<endl;
    }
    return 0;
}