#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 i,j;
    while(scanf("%lld %lld",&i,&j)==2){
    printf("%lld %lld\n",gcd(i,j),(i*j)/gcd(i,j));
    }
    return 0;
}