#include <iostream>
using namespace std;
int main(void){
    int a,b,c,d,GCD,LCM;
    while(cin >> a >> b){
        c = a;
        d = b;
        if((a == 0) && (b == 0)){
            cout << a << " ";
        }
        else{
            while(a != b){
                if(a > b){
                    a = a - b;
                }
                else{
                    b = b - a;
                }
            }
            GCD = a;
            cout << GCD << " ";
        }
        c /= GCD;
        LCM = c * d;
        cout << LCM << endl;
    }
}
