#include "bits/stdc++.h"
using namespace std;
int main(){
    long long x, y, st;
    while(cin >> x >> y){
        if(x >= y){
            st = gcd(x, y);
            cout << st << " ";
        }else{
            st = gcd(y, x);
            cout << st << " ";
        }
        cout << x * y / st << endl;
    }
    return 0;
}
long long gcd(long long a, long long b){
    int r;
    while(b > 0){
        r = a % b;
        a = b;
        b = r;
    }
    return a;
}