#include<iostream>
using namespace std;

int GCD(int a,int b){
    int r;
    while(b!=0){
        r=b;
        b=a%b;
        a=r;
        }
    return a;
}

int LCM(int a,int b){
    return a*b/GCD(a,b);
}
int main(){
    int a[100]={0};
    int b[100]={0};
    int i=0;
    while(cin>>a[i]>>b[i]){
  
        i++;
        }
    for(int j=0;j<i;j++)
        cout<<GCD(a[j],b[j])<<" "<<LCM(a[j],b[j])<<endl;
        
    return 0;
}