 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 
 using namespace std;
 
 long long int gcd(long long int p,long long int q)
 {
   return q==0 ? p:gcd(q,p%q);     
 }

 int main()
 {
   long long int n,m;
   while(cin>>n>>m)
   {
     long long kk=gcd(n,m);
     cout<<kk<<" "<<n/kk*m<<endl;             
   }
   //while(1);      
   return 0;    
 }