#include<iostream>
#include<algorithm>
using namespace std;
long int gcd(long int,long int);
long int lcm(long int,long int);
long int tes(long int,long int);

int main(){
  long int a,b;
  while(cin >> a >> b){
    cout << gcd(a,b);
    cout << " " << lcm(a,b) << endl;
  }
}

long int gcd(long int a,long int b){
  long int n;
  n=min(a,b);
  for(long int i=n;i>=1;i--){
    if(a%i == 0 && b%i==0)return i;
  }

}

long int tes(long int a,long int b){
  if(b == 0)return a;
  return tes(b,a%b);
}

long int lcm(long int a,long int b){
  return (a*b)/tes(a,b);
}