#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include <sstream>
using namespace std;
long long m,n,gcd,lcm;
int main()
{
    while(cin>>m>>n)
    {
        if(m==1||n==1)
        {
            cout<<1<<" "<<m*n<<endl;
        }
        else
        {

        long long d=0,s=m;
       if(m>n)
       {
         s=n;
       }
       for(long long i=1;i<=s;i++)
       {
           if(m%i==0&&n%i==0)
           {
               d=max(d,i);
           }
       }
       cout<<d<<" "<<(m*n)/d<<endl;

        }
    }
}

