#include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main(){
    long long a,b,i,f;
    cin>>a>>b;
    for(i=20000000;i>0;i--){
        if(a>=2000000000||b>=2000000000){
            break;
        }
        if(a%i==0&&b%i==0){
            cout<<i<<" ";
            
                break;
        }
    }
    f=a*b/i;
    cout<<f<<endl;
    return 0;
}