#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
#define int long long

int gcd(int a, int b){
        int c;
        while (a!=0){ c=a; a=b%a; b=c;}
        return b;
}

signed main(){
        int a, b;
        while( scanf("%lld %lld", &a, &b) != EOF ){
                int c = gcd(a,b);
                printf("%lld %lld\n", c, (a/c)*(b/c)*c);
        }

        return 0;
}