#include <cstdio>

int main(){
    long long int m, n, gcd, lcm, temp;
    while(scanf("%lld %lld", &m, &n) == 2){
        lcm = n * m;
        if( m < n ){
            temp = m;
            m = n;
            n = temp;
        }
       for(;;){
           if(n == 0) break;
           temp = n;
           n = m % n;
           m = temp;
       }
       gcd = m;
       lcm = lcm / gcd;
       printf("%lld %lld\n", gcd, lcm);
    }
    return 0;
}