#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long LL;
LL gcd(LL a,LL b)
{
    return b == 0 ? a : gcd(b,a % b);
}
int main()
{
    LL a,b;
    while(scanf("%lld%lld",&a,&b) == 2)
    {
        if(b > a)
            swap(a,b);
        LL res = gcd(a,b);
        printf("%lld %lld\n",res,a * b / res);
    }
}
