#include <iostream>
#include <algorithm>
 
using namespace std;
 
#define rep(i, n) for(int i=0; i<(n); ++i)

long long int gcd(long long int a, long long int b) {
    if(b==0) return a;
    return gcd(b, a%b);
}
int main(void){
    long long int a, b;
    while(cin >> a >> b) {
        long long int g = gcd(a, b);
        cout << g << " " << a*b/g << endl;
    }
}