#include <iostream>

using namespace std;

typedef long long ll;

ll gcd(ll a,ll b){
  if (b==0) return a;
  return gcd(b,a%b);
}

int main(){
  ll a,b;
  while (cin>>a>>b){
    ll g,l;
    g=gcd(a,b);
    l=a*b/g;
    cout<<g<<" "<<l<<endl;
  }
  return 0;
}