#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
    long long int a,b,n=0;
    while(cin >> a >> b){
        if (a>b) {
            n = b;
            while (a % b != 0) {
                b = a % b;
            }
            cout << b << " " << a*n/b << endl;
        }
        
        if (b>a) {
            n = a;
            while (b % a != 0) {
                a = b % a;
            }
            cout << a << " " << b*n/a << endl;
        }

    }
    
    
}