#include <stdio.h>
#include <stdlib.h>

long long gcd(int a,int b){
    if(b==0){
        return a;
    }
    else
        return gcd(b,a%b);
}

int main()
{
    long long x,y,l=0,g=0;
    while(scanf("%lld %lld",&x,&y)==2){
        printf("%lld %lld\n",gcd(x,y),(x*y)/gcd(x,y));
    }
    return 0;
}