#include <iostream>
#include <vector>
#include <cmath>
#include <map>

typedef long long ll;
using namespace std;

ll gcd(int a, ll b)
{
        if(b == 0)
        {
                return a;
        }
        else
        {
                return gcd(b, a % b);
        }
}

int main()
{
ll a,b;
while(~scanf("%lld %lld",&a,&b)){
printf("%lld %lld",gcd(a,b),(a*b)/gcd(a,b));
}
}