#include <stdio.h> 
long gcd_euclid(long m, long n) 
{ 
    long tmp; 
    while (n) { 
        temp = m % n; m = n; n = tmp;
        } return m; 
    
} int main(){ 
    long a, b; 
    long tmp; 
    long gcd; 
    while(scanf("%ld %ld", &a, &b)!=EOF){ 
        gcd = gcd_euclid(a, b); 
        temp = a / gcd;
        
        printf("%ld %ld\n", gcd, lcm); 
        
    } return 0; 
    
}
