#include <cstdio>
#include <cmath>

using namespace std;

int main()
{
    int a,b;

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

        for(int i=2;i<=((a<b)? b:a);i++){
            if((a%i==0)&&(b%i==0)) gcd=i;
        }

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

    return 0;
}