#include <iostream>
#include <cstdio>
using namespace std;
int gcd(int a, int b)
{ 
    int r;  
    while((r = a % b) != 0)  
    {      
        a = b;    
        b = r;
        }  
return b
;}
int main(void)
{  
    int a, b, tmp;  
    if (a < b){     
        tmp = b;
        b = a;
        a = tmp;   
        } 
        while(cin >> a >> b) {  
            int lcm = b / gcd(a,b)*a;   
            cout << gcd(a,b) << " " << lcm << endl;    
            
        }   
return 0;
    
}

