#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n1,n2,gcd,lcm,c;
    while(scanf("%lld%lld",&n1,&n2)!=EOF)
    {

   c=__gcd(n1,n2);
    lcm=(n1*n2)/c;
        printf("%lld %lld\n",c,lcm);
        }
    return 0;
}