#include<iostream>
#include<cstdio>
#include<algorithm>

using namespace std;

int main(){

    long long int a,b;

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

    return 0;
}