#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
long long gcd(long long a,long long b); 
main(){
  long long a,b,GCD,LCM;
  while(cin >> a >> b){
    GCD = gcd( a , b );
    LCM = (a * b)/GCD;
    cout << GCD << ' ' << LCM << endl;
  }
}
long long gcd(long long a,long long b){
  if(b == 0)return a;
  return gcd( b , a % b );
}