#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)

#define int long long 
using namespace std;
signed main(){
 int a,b;
 while(cin >> a >> b){
  int g = __gcd(a,b);
  int l = a*b/g;
  cout << g << " " << l << endl;
 } 
 return 0;
}
