#include<iostream>
using namespace std;

int main(){ 
    unsigned long long int a,b,n,m;

    while(cin >> a >> b){
        if(a >= b){
            m = a;  
            n = b;  
        }       
        else{   
            n = a;  
            m = b;  
        }       

        while(n != 0){
            unsigned long int i = n;
            n = m % n;
            m = i;  
        }       
        n = a*b/m;

        cout << m << " " << n << endl;
    }
    return 0;

}