#include<iostream>
using namespace std;

int gcd(int a, int b){
        if(a == 0 ){
            return b;
        } else if ( b == 0)
        {
            return a;
        } else if (a >= b )
        {
            a = a - b * ( a / b ) ;
            return gcd(a,b);
        }
        else if ( b > a)
            {
            b = b - a * ( b / a);
            return gcd(a,b);
        }
}

int main(){
    signed int a, b;
    signed int g , l;
    while(cin >> a >> b)
        {
        g = gcd(a,b);
        l = a / g * b;
        cout << g << " " << l << endl;
    }
    return 0;
}