#include<iostream>
 
int main(){
    int a, b, r;
     
    while(std::cin >> a >> b){
        int product = a*b;
         
        // GCD
        if(a < b){
            int temp = a;
            a = b;
            b = temp;
        }
        while((r = a%b) != 0){
            a = b;
            b = r;
        }
         
        // LCM
        int lcm = product / b;
         
        // show
        std::cout << b << ' ' << lcm << std::endl;
    }
     
    return 0;
}