#include<iostream>
#include<utility>
 
int main(){
    unsigned int a, b, tmp, GCD;
    while ( std::cin >> a >> b){
        if( b > a )std::swap( a , b );
        unsigned long int LCM = a;
        GCD = b;
        while(a % GCD != 0){
            tmp = a % GCD;
            a = GCD;
            GCD = tmp;
        }
        LCM = ( LCM / GCD ) * b;
        std::cout << GCD << " " << LCM << std::endl;
    }
    return 0;
}