#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;

int gcd(int a, int b){
    if(b==0){
        return a;
    }
    return gcd(b, a%b);
}

int main()
{   int a, b;
    int temp;
    while(true){
        if(!(cin >> a >> b))exit(0);
       
        if(a<b){
            temp = b;
            b = a;
            a = temp;
        }
        temp = gcd(a, b);
        cout << temp << " " << a/temp*b << endl;
    
    }    
    return 0;
}
