#include <stdio.h>

int main(void){
    
    int a, b, r, s;
    int temp = 0;
    
    scanf("%d %d", &a, &b);
    s = a * b;
    if(a < b){
        temp = a;
        a = b;
        b = temp;
    }
    
    r = a % b;
    while(r != 0){
        a = b;
        b = r;
        r = a % b;
    }
    
    printf("%d %d\n", b, s/b);
    
    return 0;
}