#include<iostream>

using namespace std;

int GCD(long long M, long long N) {
	
    while(N != 0) { 
        long long r = M % N; 
        M = N; 
        N = r; 
    } 
    return M;
}

int LCM(long long m, long long n) {
    return m * n / GCD(m, n);
}

int main() { 
    long long m, n; 

    while( cin >> m >> n ) {

    cout << GCD(m, n) << " " << LCM(m, n) << "\n"; 
    
	}
    return 0; 
} 
