#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,x,n) for(int i=(x);i<(n);i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define ub upper_bound
#define lb lower_bound
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=1000000009;

int gcd(int a,int b){
  if(a==0||b==0)return 0;
  if(a<b) swap(a,b);
  while(b){
    if(a>b){
      int tmp=a%b;
      a=b;
      b=tmp;
    }
  }
  return a;
}

int lcm(int c,int d){
  if(c==0||d==0)return 0;
  return ((c*d/gcd(c,d)));
}


signed main(){
  int a,b;
  while(cin>>a>>b){
    cout<<gcd(a,b)<<' '<<lcm(a,b)<<endl;
  }
  return 0;
}