#include <stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
unsigned long int gcd(unsigned long int a,unsigned long int b)
{
 if(b==0)
 return a;
 else
 return gcd(b,a%b);

}
unsigned long int lcm(unsigned long int a,unsigned long int b)
{

 return a/gcd(a,b)*b;

}
int main() {
 unsigned long int a,b;

   while(cin>>a>>b)
   {
    

    cout<<gcd(a,b)<<" "<<lcm(a,b)<<"\n";
   }
    return 0;
}