//
//  main.cpp
//  b
//
//  Created by h3037178 on 2017/07/31.
//  Copyright ?? 2017??´ ?????£?????????. All rights reserved.
//

#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main(){
    long long a,b,s,d;
    while(cin>>a>>b){
        for(int o=20000000;o>0;o--){
            if(a>=20000000||b>=20000000){
                break;
            }
            if(a%o==0&&b%o==0){
                s=o;
                 d=a*b/s;
                cout<<s<<" "<<d<<endl;
                break;
            }
        }
    }
}