#include <cstdio>
#include <cmath>

using namespace std;

int main()
{
    int a,b;

    while(scanf("%d%d",&a,&b)!=EOF){
        int gcd=a,tmp_b=b;
        int tmp;
        while(tmp_b!=0){
            tmp=gcd%tmp_b;
            gcd=tmp_b;
            tmp_b=tmp;
        }

        printf("%d %d\n",gcd,(int)((long)a*b/(long)gcd));
    }

    return 0;
}