#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

const int maxn = 1e7+7;
const int INF=0x3f3f3f3f;
typedef long long LL;
LL gcd(LL a,LL b){
return b==0?a:gcd(b,a%b);
}

int main(){

LL a,b;
while(scanf("%lld%lld",&a,&b)!=EOF){
    LL g=gcd(a,b);
    LL lcm=a*b/g;
    printf("%lld %lld\n",g,lcm);
}

return 0;
}

