#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>     //by  @山?叶??     A
#include<cstdlib>
#include<cmath>
#include<string>
#include<set>
#include<sstream>
using namespace std;
typedef long long ll;
double dinf=99999999.9, mm=1e-8;
const int N=10008,inf=0x3f3f3f3f;
ll gcd(ll x,ll y)
{
    if(x%y==0)
        return y;
    else
        return gcd(y,x%y);
}
int main()
{
    ll a,b;
    while(scanf("%lld%lld",&a,&b)!=EOF)
    {
        printf("%lld ",gcd(a,b));
        ll k,ans=1;
        while(k=gcd(a,b),k!=1)
        {
           ans*=k;
           a/=k;b/=k;
        }
        ans=ans*a*b;
        printf("%lld\n",ans);
    }

    return 0;
}