#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define MOD 1000000007 //10^9+7
#define INF 1000000000 //10^9

ll gcd(ll a,ll b){
    if (b==0) return a;
    return gcd(b,a%b);
}


int main ()
{
    ll a,b;
    while (cin>>a>>b) {
        ll g=gcd(a, b);
        cout<<g<<' '<<a/g*b<<endl;
    }
    return 0;
}