#include <iostream>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;

long long a,b;
long long GCD(long long a,long long b)
{
    long long d;
    while(b != 0)
    {
        d = a%b;
        a = b;
        b = d;
    }
    return a;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    while(scanf("%lld%lld",&a,&b)!=EOF)
    {
        long long gcd = GCD(a,b);
        long long p = a/gcd,q = b/gcd;
        long long lcm = p*q*gcd;
        cout<<gcd<<" "<<lcm<<"\n";

    }
    return 0;
}