#include<iostream>

using namespace std;
int calcGcd(int a, int b){
    int d;
    if((a % b) == 0){
        return b;
    }else{
        d = calcGcd(b, a%b);
    }
    return d;
    
}

int main(){
    int a,b;

    while(cin >> a >> b){
        if(b > a){
            swap(b,a);
        }
        int gcd = calcGcd(a, b);
        int lcm = a/gcd * b;
        cout << gcd << " " << lcm << endl;
    }

    return 0;
}