//C++14 (Clang 3.8.0)

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string>
using namespace std;
typedef pair<int,int> P;
typedef unsigned long long ll;
ll gcd(ll x,ll y){
    ll ma=max(x,y),mi=min(x,y),ama=ma%mi;
    if(ama==0) return mi;
    else return gcd(mi,ama);
}
ll lcm(ll x,ll y){
    ll g=gcd(x,y);
    if(g==1) return x*y;
    return g*lcm(x/g,y/g);
}
int main(){
    ll a,b;
    while(scanf("%lld %lld", &a, &b)!=EOF){
        cout<<gcd(a,b)<<" "<<lcm(a,b)<<endl;
    }
    return 0;
};