#include<iostream>

using namespace std;

int gcd(int m,int n){
   if(m<n) swap(m,n);
   while(true){
      if(n==0) return m; 
      int tmp=n;
      n=m%n;
      m=tmp;
  }
}

int lcm(int a, int b){
//   cout <<a*b<<endl;
   return (a/gcd(a,b))*b;
}

int main(){

   int a,b;

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

   return 0;

}