#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <iomanip>
#include <map>
#include <bitset>
#include <cstdio>
#include <set>
#include <stack>
#include <queue>
#include <cassert>
#include <numeric>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define Rep1(i,k,n) for(int i=k ; i<=n ; i++)
#define rrep(i,n) for(int i=n ; i>=0 ; i--)
#define vi vector<int>
#define vii vector<vector<int>>
#define mii map<int,int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())
#define ALL(a)  (a).begin(),(a).end()
#define pb push_back
#define mp make_pair
//#define int ll
typedef long long ll;

const int md = 1000000007;
const int INF = 1<<30;
using namespace std;

int gcd(int x, int y){
    return y ? gcd(y,x%y) : x;
}

int lcm(int x, int y){
    int g = gcd(x,y);
    return g * (x/g) * (y/g);
}
int main(){
    int a;
    while(cin >> a){
        int b; cin >> b;
        cout << gcd(a,b) << " " << lcm(a,b) << endl;

    }
}

