#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;
long  yaku,bai,a,b;
long long  fe;

int GCD(int x,int y){
  if(y==0){
    return x;
  }
  else{    
    return GCD(y,x%y);
  }
}
int main(){
  for(;cin>>a;){
    cin>>b;
    if(a>b){
      yaku=GCD(a,b);
    }
    else{
      yaku=GCD(b,a);
    }
    fe = a*b;
    cout<<yaku<<" "<<fe/yaku<<endl;
  }
}