#include <iostream>
using namespace std;

int gcd(int a, int b){
    
    if ((0 == a)||(0 == b))
        return 0;
        
    while(a!=b){
        if(a>b)  a=a-b;
        else     b=b-a;
        }
        return a;
}


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

