#include <stdio.h>
typedef long long lint;
int a,b;
int gcd(int a,int b) {
    if(b==0) return a;
    return gcd(b,a%b);
}
int main() {
#ifdef debug
    freopen("in.txt","r",stdin);
#endif
    int g;
    while(scanf("%d %d",&a,&b)!=EOF) {
        g=gcd(a,b);
        printf("%d %lld\n",g,(lint)a*b/g);
    }
}