#include <iostream>
long gcm(long a,long b){
    if (b==0) return a;
    return gcm(b,a%b);
}
 
int main(void){
    long a,b,x;
    while (std::cin>>a>>b){
        x=gcm(a,b);
        std::cout<<x<<" "<<a/x*b<<"\n";
    }
}