#include<iostream>
#include <cstdio>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

////Nayeem Shahriar Joy,Applied Physics &Electronic Engineering,University of Rajshahi.

int gcd(long long int a,long long int b)
{
    long long int c;
    while(a%b!=0)
    {
        c=a%b;
        a=b;
        b=c;
    }
    return b;
}

int main()

{
   long long int a,b,k;
   while(cin>>a>>b)
   {
       k=gcd(a,b);
       cout<<k<<" "<<(a*b)/k<<endl;
   }
   return 0;
}