#include <stdio.h>
#include <cstring>
#include <algorithm>
#include <math.h>
using namespace std;
#define MAX 1000010
long long gcd(long long a,long long b)
{
    if(a%b==0)
        return b;
    else
        return gcd(b,a%b);
}
int main()
{
    long long a,b;
    while(~scanf("%lld%lld",&a,&b))
    {
        long long ans=gcd(a,b);
        printf("%lld %lld\n",ans,a/ans*b);
    }
    return 0;
}