#include <stdio.h>
#include <math.h>


long long int gcd(long long int n1, long long n2){

if(n2!=0){
    return gcd(n2, n1%n2);

    }
else
    return n1;
}
int main(){
    long long int a,b,lcm;
    while(scanf("%lld %lld",&a,&b)!=EOF){
        lcm=(a*b)/gcd(a,b);
        printf("%lld %lld",gcd(a,b),lcm);
    }
    return 0;

}