#include <iostream>
#include <algorithm>

using namespace std;

int gcd( int a, int b ){
    int t;
    int x = min(a, b);
    int y = max(a, b);
    while( y%x != 0 ){
        t = y - x;
        y = max(x, t);
        x = min(x, t);
    }
    return x;
}

int lcm( int a, int b ){
    int x = a;
    int y = b;
    while( x != y ){
        if(x<y)
            x += a;
        else
            y += b;
    }
    return x;
}

int main()
{
    int a, b;
    while( cin >> a >> b ){
        cout << gcd(a, b) << " " << lcm(a, b) << endl;
    }
    return 0;
}