#include<cstdio>

int main(){
    long a, b;
    while(scanf("%li %li", &a, &b)!=EOF){
        long x=a, y=b, memo;
        while(y){
            memo=y;
            y=x%y;
            x=memo;
        }
        printf("%li %li\n", x, a*b/x);
    }
    return 0;
}
