#include<bits/stdc++.h>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long int ll;
typedef pair<ll,ll> P;
const ll MOD=1234567;
const ll INF=1000000010;
const ll LINF=1000000000000000010LL;
const int MAX=500010;
const double EPS=1e-3;
int dx[4]={0,1,0,1};
int dy[4]={0,0,1,1};
//最大公約数
ll gcd(ll m,ll n){
    if((0==m)||(0==n)){
        return 0;
    }
    if(m<n){
        swap(m,n);
    }
    ll r=m%n;
    while(r!=0){
        m=n;
        n=r;
        r=m%n;
    }
    return n;
}
//最小公倍数
ll lcm(ll m,ll n){
    if((0==m)||(0==n)){
        return 0;
    }
    return ((m/gcd(m,n))*n);
}
int main(){
	ll a,b;
	while(cin>>a>>b){
		cout<<gcd(a,b)<<" "<<lcm(a,b)<<endl;
	}
	return 0;
}

