#include <iostream>
#include<string>
using namespace std;
void hideki(int x,int y){
    
}

int main(){
    int a,b;
    cin>>a>>b;
    int d=a*b;
    if(a>b)
    while(a%b!=0&&a>b){a=a%b;}
    else
    while(b%a!=0&&b>a){b=b%a;}
    int c=min(a,b);
    cout<<c<<" "<<d/c<<endl;
    
    return 0;
}