#include<iostream>
#define nijuoku 2000000000

using namespace std;

long long int saidaikouyaku(long long int a, long long int b){
    long long int big    = max(a,b);
    long long int little = min(a,b);
    long long int midori = big % little;
    
    while(true){
        if(midori == 0)return little;
        big    = little;        
        little = midori;
        midori = big % little;
    }
    return -1;
}

long long int saisyoukoubai(long long int a, long long int b){
    
    long long int big    = max(a,b);
    long long int little = min(a,b);
    
    for(long long int i = big; i < nijuoku; i += big){
        if(i % little == 0)return i;        
    }
    return -1;
};

            
int main(){

    long long int a, b;
    
    while(cin >> a >> b){
        cout << saidaikouyaku(a,b) << ' ' << saisyoukoubai(a,b) << endl;
	}
	return 0;
}