#include <cstdio>
using namespace std;
typedef long long LL;

LL gcd(LL a, LL b){
    while(b){
        LL tmp = a % b;
        a = b;
        b = tmp;
    }
    return a;
}
int main(){
    LL a, b;
    while(~scanf("%d%d", &a, &b)){
        printf("%lld %lld\n", gcd(a, b), (a * b / gcd(a, b)));
    }
    return 0;
}