#include <iostream>
using namespace std;
int main(){
    int a,b,lcm=0,count=0;
    while(cin>>a>>b){
    for(int k=a;k>=1;k--){
        if(a%k==0&&b%k==0) {
            lcm=k;
            break;
        }
    }
    cout<<lcm<<" "<<a*b/lcm<<endl;
}
}