#include<cstdio>
#include<algorithm>
using namespace std;
int a,b;
int GCD(int a,int b)
{
    return (b == 0)?a:GCD(b,a%b);
}
int main()
{
    while(scanf("%d %d",&a,&b) != EOF)
    {
        if(a < b)
            swap(a,b);
        int gcd = GCD(a,b);
        int lcm = (a/gcd)*(b/gcd)*gcd;
        printf("%d %d\n",gcd,lcm);
    }
    return 0;
}

