#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long ll;

ll gcd(ll a,ll b)
{
    if (!b) return a;
    else return gcd(b,a%b);
}

int main()
{
    ll a,b;
    while(cin>>a>>b)
    {
        ll gcd1=gcd(a,b);
        ll lcm1=a/gcd1*b;
        cout<<gcd1<<" "<<lcm1<<endl;
    }
}