#include <iostream>
 
 
using namespace std;
 
int main() {
 
    long ain,bin;
    long c,d,e,gcm,lcd;
     
    cin >> ain >> bin;
    if (ain < bin) {
        c = ain;
        ain = bin;
        bin = c;
        c=0;
    }
 
    c=ain;
    d=bin;
 
    for(;;) {
        if(d==0) {
            gcm = c;
            lcd = ain * bin / gcm;
            break;
        }
        e = c % d;
        c = d;
        d = e;
    }
 
    cout << gcm << " " << lcd << endl;
 
 
    return 0;
}