#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <cstring>
#include <set>
#include <queue>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
typedef int ll;
/*ll gcd(ll a,ll b){
    return (b == 0)?a:gcd(b, a % b);
}*/

ll  gcd(ll a, ll b){
    ll t;
    while(b>0){
        t = a % b;
        a = b;b = t;
    }
    return a;
}
ll lcm(ll a, ll b){
    return a / gcd(a,b) * b;
}
int main()
{
	ll a,b;
	while(cin>>a>>b){
        cout<<gcd(a,b)<<" "<<lcm(a,b)<<endl;
	}
	return 0;
}