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

long gcd(long a, long b){
    if(b == 0){
        return a;
    }else{
        if(a < b){
            swap(a, b);
        }
        gcd(b, a%b);
    }
}

int main(){
    long a, b = 0;
     
    while(cin >> a >> b){
        long tmp = gcd(a, b);
        
        cout << tmp << " " << a*b/tmp << endl;
    }
    
    return 0;
}