#include <iostream>
#include <cstdio>
#include <cstdlib>

using namespace std;

long long gcd(long long a,long long b)
{
    return !b ? a : gcd(b, a%b);
}

long long lcm(long long a,long long b)
{
    long long d = gcd(a,b);
    return (a/d)*b;
}

int main()
{
    long long a,b;
    while(scanf("%lld %lld",&a,&b) != EOF)
    {
        printf("%lld %lld\n",gcd(a,b),lcm(a,b));
    }
    return 0;
}