#include<iostream>
#include<climits>

using namespace std;

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

int main(){
  
  unsigned long long a,b;
  cin>>a>>b;
  
  unsigned long long ans1 = gcd(a,b);
  cout<<ans1<<" "<<b/ans1*a<<endl;
  return 0;
}