#include<iostream>
using namespace std;

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

    while( cin >> a >> b )
    {

        if( a > b && a % b == 0 )       //値が大きい場合の最大公約数を先に求めておく
        {
            cout << b << " " << a << endl;
            break;
        }
        if( b <= a && b % a == 0 )
        {
             cout << a << " " << b << endl;
            break;
        }

        for( int i = a; i > 0; i-- ) 
        {
                if( a % i == 0 && b % i == 0 ) 
                {
                    cout << i << " " << a * b / i << endl;
                    break;
                }
        }
    }
    return 0;
}

